Advertisement
Guest User

Untitled

a guest
Jun 12th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. 'use strict';
  2.  
  3. var loopback = require('loopback');
  4. var boot = require('loopback-boot');
  5.  
  6. var app = module.exports = loopback();
  7.  
  8.  
  9.  
  10. let port = process.env.PORT;
  11. if (port == null || port == "") {
  12. port = 3000;
  13. }
  14.  
  15.  
  16. app.start = function() {
  17. // start the web server
  18. return app.listen(/*function() {
  19. app.emit('started');
  20. var baseUrl = app.get('url').replace(/\/$/, '');
  21. console.log('Web server listening at: %s', baseUrl);
  22. if (app.get('loopback-component-explorer')) {
  23. var explorerPath = app.get('loopback-component-explorer').mountPath;
  24. console.log('Browse your REST API at %s%s', baseUrl, explorerPath);
  25. }
  26. }*/port);
  27. };
  28.  
  29. // Bootstrap the application, configure models, datasources and middleware.
  30. // Sub-apps like REST API are mounted via boot scripts.
  31. boot(app, __dirname, function(err) {
  32. if (err) throw err;
  33.  
  34. // start the server if `$ node server.js`
  35. if (require.main === module)
  36. app.start();
  37. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement