Created
November 14, 2015 20:39
-
-
Save joeyjiron06/263dfd431a80b7e85960 to your computer and use it in GitHub Desktop.
A simple web server written in 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
NODE JS WEB 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
{ | |
"name": "app", | |
"private": false, | |
"version": "0.0.1", | |
"description": "A web application", | |
"license": "MIT", | |
"devDependencies": { | |
"express": "^2.12.0", | |
} | |
} |
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 http = require('http'); | |
var express = require('express'); | |
var port = 8080; | |
var app = express(); | |
app.use(express.static(__dirname)); | |
app.get('/', function (request, response) { | |
response.sendfile("index.html"); | |
}); | |
console.log('listening on port ' + port); | |
app.listen(port); | |
module.exports=app; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment