Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
@mikrokit/http
Advanced tools
MikroKit HTTP Server for quick Api development.
MikroKit HTTP Server for quick Api development.
@mikrokit/http
MikroKit router is an RPC like router oriented for quick Api development, it is agnostic about the environment it is used on. It could be used on serverless environments, or as an standalone http server.
MikroKit Server is well suited a very specific scenario, that is Apis that works with json data only. In return it offers quick development, fast execution and a Lightweight router 🚀.
This is a limited http server, only supports application/json
content type, does not support multipart/form-data, no websocket or streams and no file upload neither. There are better alternatives for those scenarios (like S3 file upload, etc).
RPC like router
MikroKit router uses a Remote Procedure Call style routing, unlike traditional routers it does not use GET
, PUT
, POST
and DELETE
methods, everything is transmitted using HTTP POST
method and all data is sent/received in the request/response body
and headers
.
HTTP POST
method.body
and headers
.JSON
format.Routing
🚀 Lightweight router based in plain javascript objects.
Thanks to it's RPC style there is no need to parse parameters or regular expressions when finding a route. Just a simple Map in memory containing all the routes.
Route parameters
are passed as an array in the request body, in a field with the same name as the route. Elements in the array must have the same order as the function parameters.
Route response
is send back in the body in a field with the same name as the route.
The reason for this weird naming is to future proof the router to be able to accept multiple routes on a single request. However this can be changed setting the routeFieldName
in the router options.
// ../router/examples/routes-definition.routes.ts
import {Route, Handler, Routes, MkRouter} from '@mikrokit/router';
const sayHello: Handler = (context, name: string): string => {
return `Hello ${name}.`;
};
const sayHello2: Route = {
route(context, name1: string, name2: string): string {
return `Hello ${name1} and ${name2}.`;
},
};
const routes: Routes = {
sayHello, // api/sayHello
sayHello2, // api/sayHello2
};
MkRouter.setRouterOptions({prefix: 'api/'});
MkRouter.addRoutes(routes);
MIT LICENSE
FAQs
MikroKit HTTP Server for quick Api development.
The npm package @mikrokit/http receives a total of 0 weekly downloads. As such, @mikrokit/http popularity was classified as not popular.
We found that @mikrokit/http demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.