Skip to content

Instantly share code, notes, and snippets.

@dileephell
Created December 5, 2012 11:32
Show Gist options
  • Save dileephell/4214896 to your computer and use it in GitHub Desktop.
Save dileephell/4214896 to your computer and use it in GitHub Desktop.
var express = require('express')
, app = express()
, fs = require('fs');
// Routes
app.get('/form', function(req, res)
{
fs.readFile('./form.html', function(error, content)
{
if (error)
{
res.writeHead(500);
res.end();
}
else
{
res.writeHead(200, { 'Content-Type': 'text/html' });
res.end(content, 'utf-8');
}
})
}).listen(process.env.PORT);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment