Skip to content

Instantly share code, notes, and snippets.

@ThisIsDjonathan
Last active October 10, 2018 13:37
Show Gist options
  • Save ThisIsDjonathan/75bcca9d222907eae832280689f9ba73 to your computer and use it in GitHub Desktop.
Save ThisIsDjonathan/75bcca9d222907eae832280689f9ba73 to your computer and use it in GitHub Desktop.
Step by step to create NodeJS Express local server
/*
1. Add express
$ npm install express --save
2. Add cors
$ npm install cors --save
3. On Windows, add new firewall rule to allow receive request on PORT
*/
// 4. Configure and start server
let express = require('express')
let cors = require('cors')
let app = express()
app.use(cors())
app.use(express.static('./public'))
// Use port opened on firewall
app.listen(80)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment