Last active
October 10, 2018 13:37
-
-
Save ThisIsDjonathan/75bcca9d222907eae832280689f9ba73 to your computer and use it in GitHub Desktop.
Step by step to create NodeJS Express local server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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