简体   繁体   中英

How to generate feathersjs primus client without starting the server

I use below code to generate featherjs-primus client js file. But the primus function is not called until I call app.listen() . Is there a way for me to generate this file without start the server?

app
  .configure(primus({
    transformer: 'websockets',
    timeout: false
  }, (primus) => {
    const lib = primus.library();
    primus.save(path.join(__dirname, '../public/dist/primus.test.js'));
  }))

You can call app.setup instead of app.listen to run that callback. The websocket providers will however need an HTTP server passed to app.setup . More information can be found in the middleware chapter .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM