@tenp/core
TypeScript icon, indicating that this package has built-in type declarations

0.0.17 • Public • Published


Based on the express implementation, using typescript enhancements, creating services via pm2

npm version

👉👉👉API Docs




Framework progress

功能 状态
express completed
typescript completed
router completed
interceptor completed
validation perfect
Api interface undefined
pm2 completed
throw completed
cli completed,optimization
surroundings completed

Installed via npm

$ npm install @tenp/cli -g
$ tenp init hellworld
$ cd hellworld
$ tenp dev

Create service

import { Application } from 'express'
import { Start ,Router, Config, Get, Request, Response } from '@tenp/core';
@Router() 
class HelloWord{

	private msg: string = 'Hello, world'

	@config({ url: '/hello', name: 'hello', type: 'get' })
	private hello(req: Request, res: Response): void {
		res.end(`<h1>${this.msg}</h1>`)
	}
	
	@Get('/world')
	private world(req: Request, res: Response): void {
		res.end(`<h1>${this.msg}</h1>`)
	}

}
Start({
	port: 8080,
	router: [ HelloWord ],
}).then((app: Application) => {
	console.log('success')
})

Package Sidebar

Install

npm i @tenp/core

Weekly Downloads

0

Version

0.0.17

License

ISC

Unpacked Size

109 kB

Total Files

53

Last publish

Collaborators

  • xiaoyou