Skip to content

Instantly share code, notes, and snippets.

@joeyjiron06
Created November 14, 2015 20:39
Show Gist options
  • Save joeyjiron06/263dfd431a80b7e85960 to your computer and use it in GitHub Desktop.
Save joeyjiron06/263dfd431a80b7e85960 to your computer and use it in GitHub Desktop.
A simple web server written in node.js
NODE JS WEB SERVER
{
"name": "app",
"private": false,
"version": "0.0.1",
"description": "A web application",
"license": "MIT",
"devDependencies": {
"express": "^2.12.0",
}
}
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