Skip to content

Instantly share code, notes, and snippets.

@jazzyjackson
Created May 16, 2017 04:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jazzyjackson/3e54b203547a92b3ddccb02ced54a1a6 to your computer and use it in GitHub Desktop.
Save jazzyjackson/3e54b203547a92b3ddccb02ced54a1a6 to your computer and use it in GitHub Desktop.
const repl = require('repl')
const Koa = require('koa')
const app = new Koa()
app.context.defaultMsg = "Hello World"
app.use( ctx => ctx.body = app.context.defaultMsg )
app.listen(3000)
repl.start({prompt: '> ', eval: myEval});
function myEval(stdin, context, filename, stdout) {
stdout(eval(stdin))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment