flaska/test.mjs

23 lines
438 B
JavaScript

import { Flaska } from './flaska.mjs'
const port = 51024
const flaska = new Flaska({}, )
flaska.get('/', function(ctx) {
return new Promise(function(res, rej) {
ctx.body = { status: true }
setTimeout(res, 1000)
})
})
flaska.after(function(ctx) {
if (ctx.aborted) {
process.stdout.write("A")
} else {
process.stdout.write(".")
}
})
flaska.listen(port, function() {
console.log('listening on port', port)
})