21 lines
398 B
JavaScript
21 lines
398 B
JavaScript
|
import { Flaska } from './flaska_fast.mjs'
|
||
|
|
||
|
const port = 51028
|
||
|
const flaska = new Flaska({}, )
|
||
|
|
||
|
flaska.get('/', function(ctx) {
|
||
|
ctx.body = { status: true }
|
||
|
})
|
||
|
|
||
|
flaska.get('/:item/asdf/herp/:derp/bla', function(ctx) {
|
||
|
ctx.body = { item: ctx.params.item }
|
||
|
})
|
||
|
|
||
|
flaska.get('/error', function(ctx) {
|
||
|
process.exit(1)
|
||
|
})
|
||
|
|
||
|
flaska.listen(port, function() {
|
||
|
console.log('listening on port', port)
|
||
|
})
|