26 lines
478 B
JavaScript
26 lines
478 B
JavaScript
import { Flaska } from './flaska.mjs'
|
|
|
|
const port = 51026
|
|
const flaska = new Flaska({}, )
|
|
|
|
flaska.devMode()
|
|
|
|
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('/a', function(ctx) {
|
|
ctx.body = { status: true }
|
|
})
|
|
|
|
flaska.get('/error', function(ctx) {
|
|
process.exit(1)
|
|
})
|
|
|
|
flaska.listen(port, function() {
|
|
console.log('listening on port', port)
|
|
})
|