Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

express js basic example

//to run : node filename.js
const express = require('express')
const app = express()
const port = 3000

app.get('/', (req, res) => res.send('Hello World!'))

app.listen(port, () => console.log(`Example app listening at http://localhost:${port}`))

//visit localhost:3000
// assuming you have done 1) npm init 2) npm install express
Comment

how to add express in node js

//in terminal write
npm install express
Comment

PREVIOUS NEXT
Code Example
Javascript :: js variable for key obj 
Javascript :: how to navigate with navintems for react-bootstrap without refreshing the whole page 
Javascript :: mongoose search query for a word in a field 
Javascript :: how to get ip address and port from url in javascript 
Javascript :: js spread operator component example 
Javascript :: column cannot be cast automatically to type bigint postgres sequelize 
Javascript :: servicenow gliderecord lookup 
Javascript :: having written a counter with redux how does it work 
Javascript :: get contents between tags javascript 
Javascript :: how to define width with [styles] in percentage in angular 
Javascript :: blob to pdf javascript 
Javascript :: if text is present make div hide 
Javascript :: what is javascript used for 
Javascript :: angular property binding 
Javascript :: how to create json file in android programmatically 
Javascript :: Min JavaScript Methods 
Javascript :: add new array at the back of react state 
Javascript :: Font Size changed from device OS react native app 
Javascript :: splice 
Javascript :: javascript seconds after input 
Javascript :: dropzone upload on one file 
Javascript :: multiple image upload react 
Javascript :: How do I access a class without an instance? +javascript 
Javascript :: array.fill() in javascript 
Javascript :: usecontext 
Javascript :: javascript Iterate Sets 
Javascript :: ion change ionic angular 
Javascript :: changing map style react-leaflet 
Javascript :: how to add object to array javascript 
Javascript :: canvas setup 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =