Jenderal92

Untitled

Jul 22nd, 2022
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. const express = require('express');
  2. const bodyParser = require('body-parser');
  3. const dbConfig = require('./config/database.config.js');
  4.  
  5. const app = express();
  6.  
  7. // parse requests of content-type - application/x-www-form-urlencoded
  8. app.use(bodyParser.urlencoded({ extended: true }))
  9.  
  10. // parse requests of content-type - application/json
  11. app.use(bodyParser.json())
  12.  
  13. // define a simple route
  14. app.get('/', (req, res) => {
  15. res.json({"message": "Welcome to ExpertPHP.in"});
  16. });
  17.  
  18. require('./app/routes/category.routes.js')(app);
  19.  
  20. // listen for requests
  21. app.listen(3000, () => {
  22. console.log("Node JS Server running on port 3000");
  23. });
Advertisement
Add Comment
Please, Sign In to add comment