Skip to content

TrapTS/core

Repository files navigation

trap-core

get started

  • install

     yarn add @trapts/core
    
  • example

     import { Server } from '@trapts/core'
     import * as bodyParser from 'koa-bodyparser'
     
     const bootstrap = () => {
     	const server = new Server()
     
     	// bind cache client to context
     	server.bindToContext('cache', new Cache({ stdTTL: 86400000 }))
     	
     	// koa middleware
     	server.use(bodyParser())
     	
     	// koa keys
     	server.keys(['Hello', 'World'])
     	
     	// start
     	server.start(3000)
     }
     
     bootstrap()

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published