SHARE
TWEET

Untitled

a guest Jun 12th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top