Skip to content

Instantly share code, notes, and snippets.

@rikukissa
Created June 12, 2014 09:17
Show Gist options
  • Save rikukissa/5d1c54758586d7bfd8ed to your computer and use it in GitHub Desktop.
Save rikukissa/5d1c54758586d7bfd8ed to your computer and use it in GitHub Desktop.
path = require 'path'
express = require 'express'
bodyParser = require 'body-parser'
app = express()
if app.get('env') in ['development', 'test']
app.use express.static path.join __dirname, '../', 'public'
app
.use bodyParser()
.use cookieParser()
app.route '/api/foo'
.get (req, res, next) ->
res.send 'foobar'
app.listen 9001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment