Skip to content

Repository files navigation

A fast, simple cross-runtime framework.

import{router}from'@mapl/framework';importjitfrom'@mapl/framework/jit';// Cache responseconsterrorResponse=newResponse(null,{status: 500});constapi=router(// no parsers[],// base path for all routes of this instance (optional)'/@:org',).get('/:pkg',// inferred context as { res: ResponseSender, params: { org: string, pkg: string }}({ res, params })=>{res.headers.set('x-powered-by','mapl');returnres.body(`package: @${params.org}/${params.pkg}`);},).on('error',(err)=>{console.error(err);returnerrorResponse;});exportdefault{// compile to a fetch functionfetch: jit(api),};

About

A fast, simple cross-runtime framework.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages