Skip to content

Instantly share code, notes, and snippets.

@tj
Created July 9, 2011 05:10
Show Gist options
  • Save tj/1073340 to your computer and use it in GitHub Desktop.
Save tj/1073340 to your computer and use it in GitHub Desktop.
luna -> js, just for fun since it's trivial to output js
express = require('express')
app = express createServer()
app get('/'): req res next
return res send('<p>Hello</p>') if req accepts('html')
return res send('Hello') if req accepts('text')
next()
app listen(3000)
console log('Express app started on port 3000')
var express = require('express');
var app = express.createServer();
app.get('/', function(req, res, next){
if (req.accepts('html')) return res.send('<p>Hello</p>');
if (req.accepts('text')) return res.send('Hello');
return next();
});
app.listen(3000);
return console.log('Express app started on port 3000');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment