Guest User

Untitled

a guest
Dec 15th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. //require dependencies
  2. const express = require('express'),
  3. const app = express(),
  4. const router = express.Router();
  5. const port = process.env.PORT || 4200,
  6.  
  7.  
  8. //define a route, usually this would be a bunch of routes imported from another file
  9. router.get('/', function (req, res, next) {
  10. res.send('Welcome to the Kushy API');
  11. });
  12.  
  13. //add routes to express app
  14. routes(app);
  15.  
  16. //start Express server on defined port
  17. app.listen(port);
  18.  
  19. //log to console to let us know it's working
  20. console.log('Kushy API server started on: ' + port);
Add Comment
Please, Sign In to add comment