Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.

Repository files navigation

express-component

Component-based routing on top of Express

import*asexpressfrom"express"import{withRouterFactory,Router,Get,HandleFn,TryJson,Component,Handler,GetTryJson}from"express-component";classMyComponentimplementsComponent{nice: HandleFn=(req,res)=>({nice: "nice"})handleCatch=(err: any)=>{console.error(err)}getChildContext(){return"The context!"}render(){returnnewRouter({path: "/api",children: [newGetTryJson({path: "/nice",child: this.nice,onCatch: this.handleCatch})]})}}constapp=express()withRouterFactory(express.Router)(newMyComponent(),app)app.listen(9090)

About

Component-based routing on top of Express

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages