Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/saber2pr/httpserver-ioc
> httpserver-ioc framework.
https://github.com/saber2pr/httpserver-ioc
httpserver ioc typescript
Last synced: about 1 month ago
JSON representation
> httpserver-ioc framework.
- Host: GitHub
- URL: https://github.com/saber2pr/httpserver-ioc
- Owner: Saber2pr
- Created: 2019-05-14T15:09:09.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-05-16T02:31:12.000Z (over 5 years ago)
- Last Synced: 2024-11-09T00:34:49.244Z (3 months ago)
- Topics: httpserver, ioc, typescript
- Language: TypeScript
- Size: 15.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @saber2pr/httpserver-ioc
> httpserver-ioc framework.
> use @saber2pr/reflect.
```bash
# from npm
npm install @saber2pr/httpserver-ioc# from github
git clone https://github.com/Saber2pr/-saber2pr-httpserver-ioc.git
```## Feature
> classMeta -(parse)-> astNode -(transform)-> unitListener
```ts
@Injectable()
class UserService {
public getUserName() {
return 'saber2pr!'
}public getHello() {
return 'Hello!'
}
}@Controller('/user')
class UserController {
constructor(
private ContextService: ContextService,
@Inject('UserService') private UserService: UserService
) {}@Get('/login')
public login() {
this.ContextService.response.end(this.UserService.getUserName())
}@Get('/hello')
public hello() {
this.ContextService.response.end(this.UserService.getHello())
}
}new Factory([UserController])
.create()
.listen(3001, () => console.log('http://localhost:3001'))
// http://localhost:3001/user/login
// http://localhost:3001/user/hello
```---
## start
```bash
npm install
``````bash
npm startnpm run dev
```
> Author: saber2pr
---
## develope and test
> you should write ts in /src
> you should make test in /src/test
> export your core in /src/index.ts!