Answers for "pROGRAMMIZ"

0

pROGRAMMIZ

//This is a simple nodejs API By Kamala Fizzet
const express=require("express");
const app=express();
const cors=require("cors");

//Setting middlewares
app.use(express.urlEncoded({extended:true}));
app.use(express.json());
app.use(cors());

app.get("/", (req, res){
        res.json({message:"This is a homepage"})
})

const port=3200;
app.listen(port, () =>{
console.log(`Server running on port ${port}`)});
Posted by: Guest on January-12-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language