Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ootkin/deest
A minimal framework on top of express to build organized restful api
https://github.com/ootkin/deest
api backend decorators express framework javascript nodejs rest-api restful restful-api typescript webserver
Last synced: about 1 month ago
JSON representation
A minimal framework on top of express to build organized restful api
- Host: GitHub
- URL: https://github.com/ootkin/deest
- Owner: ootkin
- Created: 2019-04-24T08:07:46.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-05-08T10:05:03.000Z (over 5 years ago)
- Last Synced: 2023-12-15T16:59:10.896Z (11 months ago)
- Topics: api, backend, decorators, express, framework, javascript, nodejs, rest-api, restful, restful-api, typescript, webserver
- Language: TypeScript
- Homepage:
- Size: 204 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# deest
A minimal framework on top of express to build organized restful api.# Table of Contents
* [Installation](#installation)
* [Define controllers](#define-controllers)
* [Arguments decorators](#arguments-decorator)## Installation
1. Install package:`npm install --save deest`
```typescript
import { Server } from "deest";const server: Server = new Server({
port: process.env.port || "8080",
/**
* This is used to validate body and query parameters
* with class-validator
* @see https://github.com/typestack/class-validator
*/
validate: true
});server.init({
middlewares: [
// Global express middlewares
],
errorHandlers: [
// Custom express error handlers
],
controllers: [
// Controller classes
],
});server.listen(() => {
console.log(`Server is listening on port ${server.getPort()}`);
});
```## Define controllers
* Create a controller:
```typescript
import { Controller, Get, Post, Put, Patch, Delete } from "deest"@Controller("/users")
export class UserController {
@Get()
findAll() {
return []
}
@Post()
save() {
return { message: 'user has been saved' };
}
@Put()
save() {
return { message: 'user has been updated' };
}
@Patch()
save() {
return { message: 'user has been updated' };
}
@Delete()
save() {
return { message: 'user has been deleted' };
}
}
```## Arguments decorators
TDB...