Norwegian Parcel Mail

    @futurert/rescript-koa-router

    0.0.1-alpha.2 • Public • Published

    Rescript-Koa-Router

    install

    npm install @futurert/rescript-koa-router @koa/router @futurert/rescript-koa koa

    This command will install all koa requirements.

    • @koa/router Router middleware for Koa.

    • @futurert/rescript-koa-router rescript bindings for @koa/router

    • koa lightweight web framework for node.js, find more...

    • @futurert/rescript-koa rescript bindings for koa

    How to use this?

    open Router
    open Koa
    
    let app = Koa.koa()
    
    let router = Router.router(None)
    
    router->get("/login", (context, next) => {
        context.body = "hello"
    })
    
    app->use(router->routes())
    
    let _ = app->listen(8080, _ => {Js.Console.log("server is start success!")})

    Just like this, you should using this router with rescript-koa, try it for fun!

    Install

    npm i @futurert/rescript-koa-router

    DownloadsWeekly Downloads

    141

    Version

    0.0.1-alpha.2

    License

    MIT

    Unpacked Size

    41 kB

    Total Files

    9

    Last publish

    Collaborators

    • dolphinjs