@vsmi/sinx
v0.0.15
Published
a simple http server library
Downloads
2
Readme
@vsmi/sinx
a simple http server library
GET STARTED
import sinx from '@vsmi/sinx';
import path from 'path';
const PORT = 9071;
sinx
.server({
port: PORT,
})
.addRouter(
sinx
.router()
.all('/favicon.ico', (context) => {
context.cache().setContentType('image/x-icon').emitFile(path.resolve(__dirname, './public/favicon.ico'));
})
.all('/', (ctx) => {
return 'Hello Sinx!';
})
)
.start(() => {
console.log(`Server is running at http://localhost:${PORT}/`);
});
LICENSE
MIT