Helper to build koa-router apis easily
- node 14 or higher
- koa-router
- koa
importApiBuilderfrom"koa-api-builder";constgroup=newApiBuilder().path((group)=>{group.post('/login',loginRequest).post('/signup',signupRequest).path('/user/:userId/accounts',ifAuthenticated,(group)=>{group.get(listAccountsRequest).post(ifAllowed,insertAccountRequest).path('/:accountId',(group)=>{group.get(findAccountRequest);group.put(updateAccountRequest);group.del(ifAllowed,delAccountRequest);group.get('/transactions',listTransactionsRequest);});});});// then we build our api definition into a regular koa-routerconstrouter=group.build();See router section on koa wiki
This api builder is heavily copied from Javalin's group handler
- Initial implementation
- Test and coverage
- Publish npm package
- Add linting tool
- Publish every new tag
- Publish coverage results
Add specialrenderpseudo-verb for template engines- Add Server Sent Events configuration support
- Add WebSockets configuration support
See the changelog for more details