npm express
$ npm install express
npm express
$ npm install express
express js server
const express = require('express');
const app = express();
const PORT = process.env.PORT || 3000;
app.get('/', (req, res) => {
res.send('<h1>Some HTML</h1>');
res.send('<p>Even more HTML</p>');
});
app.listen(PORT, () => console.log(`Server is listening on port ${PORT}`));
npm express
// npm install express
const express = require('express');
const app = express();
app.get('/', (req, res)=> {
res.send('Hello World');
})
app.listen(3000,()=>{
console.log("starting...");
});
node js express
basic server
const express =require('express');
const app = express();
const PORT = 5000;
app.get('/',(req,res)=>{
res.json({message: 'Welcome to the backend'})
})
app.listen(PORT ,()=>console.log(`Connected to ${PORT}`)
require express server.js
const express = require('express')const app = express() app.get('/', function (req, res) { res.send('Hello World')}) app.listen(3000)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us