Last active
September 26, 2017 09:39
-
-
Save vianhanif/89b70b7c35eee7ab51c5779a67eb9f3d to your computer and use it in GitHub Desktop.
sample server node.js
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
{ | |
"name": "sha224_tester", | |
"version": "1.0.0", | |
"description": "", | |
"author": "Alvian Rahman Hanif", | |
"private": true, | |
"scripts": { | |
"postinstall": "npm install express" | |
} | |
} |
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
var express = require('express'); | |
var path = require('path'); | |
var serveStatic = require('serve-static'); | |
app = express(); | |
app.use(serveStatic(__dirname)); | |
var port = process.env.PORT || 5000; | |
app.listen(port); | |
console.log('server started '+ port); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment