const express = require('express'); 
      require("dotenv").config(); 
      const bodyParser = require('body-parser');
      
      const app = express();
      
      app.use(bodyParser.urlencoded({extended: true}))
      app.use(bodyParser.json());
      
      app.get('/getRoute', (req, res) => {
        console.log(body);
        res.send('Welcome to the GET route suggested by Codiga!')
      })
      
      
      app.post('/postRoute', (req, res) => {
        const body = req.body;
        console.log(body);
        res.send('Welcome to the POST route suggested by Codiga!')
      })
      
      const port = process.env.PORT || 5000;
      app.listen(port, () => {
        console.log("app running on port 5000!")
      })

      Javascript language logo
      your recipe card header background
      express boiler plate

      boiler
      code
      plate
      ...

      app.use(express.static(__dirname + '/public')); app.use(express.bodyParser.urlencoded({extended: true})); app.use(express.bodyParser.json());

      app.get('/getRoute', (req, res) => { console.log(body); res.send('Welcome to the GET route suggested by Codiga!') })

      app.post('/postRoute', (req, res) => { const body = req.body; console.log(body); res.send('Welcome to the POST route suggested by Codiga!') })

      app.listen(port, () => { console.log("app running on port 5000!") })

      app.use(express.static(__dirname + '/public')); app.use(express.bodyParser.urlencoded({extended: true})); app.use(express.bodyParser.

      Shortcut: express

      Filename pattern: *.js

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.