Created
April 13, 2016 01:39
-
-
Save Chadtech/fa1cea3c7a8958fbef640e558b8d32ad to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| fs = require 'fs' | |
| express = require 'express' | |
| app = express() | |
| http = require 'http' | |
| {join} = require 'path' | |
| bodyParser = require 'body-parser' | |
| app.use bodyParser.json() | |
| PORT = Number process.env.PORT or 2998 | |
| app.use express.static join __dirname, '/public' | |
| app.get '/', (req, res, next) -> | |
| indexPage = join __dirname, 'public/index.html' | |
| res.status 200 | |
| .sendFile indexPage | |
| httpServer = http.createServer app | |
| httpServer.listen PORT, -> | |
| console.log 'SERVER RUNNING ON ' + PORT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment