2.11.4 • Published 6 months ago
@ravshansbox/mini-app v2.11.4
Mini app
Usage examples
import { createServer } from 'node:http';
import { createRequestListener, createRouter, listen, sendJson } from '@ravshansbox/mini-app';
const infoRouter = createRouter();
infoRouter.get('/about', ({ response }) => {
sendJson(response, { message: 'Mini app' }, 200);
});
const testRouter = createRouter();
testRouter.get('/:id', ({ pathParams, searchParams, response }) => {
sendJson(response, { pathParams, searchParams }, 200);
});
const app = createRouter();
app.addRoutes('/info', infoRouter.routes);
app.addRoutes('/test', testRouter.routes);
const server = createServer();
server.on('request', createRequestListener(app.routes));
const addressInfo = await listen(server, 8080);
console.info('Listening on', addressInfo);
Execute
curl "localhost:8080/info/about"
and
curl "localhost:8080/test/123?q=456"
2.11.0
6 months ago
2.11.1
6 months ago
2.10.0
6 months ago
2.7.0
6 months ago
2.6.0
8 months ago
2.9.0
6 months ago
2.8.1
6 months ago
2.8.0
6 months ago
2.11.4
6 months ago
2.11.2
6 months ago
2.11.3
6 months ago
2.5.0
12 months ago
2.3.0
1 year ago
2.2.0
1 year ago
2.4.0
1 year ago
2.3.1
1 year ago
2.1.3
1 year ago
2.1.2
1 year ago
2.1.1
1 year ago
2.1.0
1 year ago
2.0.1
1 year ago
2.0.0
1 year ago
1.3.0
4 years ago
1.2.0
4 years ago
1.1.1
4 years ago
1.2.1
4 years ago
1.1.0
4 years ago
1.0.0
4 years ago
0.8.0
5 years ago
0.7.0
5 years ago
0.6.0
5 years ago
0.5.0
5 years ago
0.4.0
5 years ago
0.3.1
5 years ago
0.2.0
5 years ago
0.1.2
5 years ago
0.1.1
5 years ago
0.1.0
5 years ago
0.0.1
5 years ago