The most mature backend framework for Deno. Create awesome HTTP and WebSocket server as well as KVQueue workers !
Attributes
Includes Deno configuration
Repository
Current version released
3 years ago
Dependencies
deno.land/x
Versions
- 2.4.1Latest
- 2.4.0
- 2.3.1
- 2.3.0
- 2.2.0
- 2.1.0
- 2.0.1
- 2.0.0
- 2.0.3-alpha
- 2.0.2-alpha
- 2.0.1-alpha
- 2.0.0-alpha
- 1.8.0
- 1.7.4
- 1.7.3
- 1.7.2
- 1.7.1
- 1.7.0
- 1.6.0
- 1.5.0
- 1.4.0
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.1
- 1.1.0
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- v1.0.0
- v0.7.2
- v0.7.1
- v0.7.0
- v0.6.4
- v0.6.3
- v0.6.2
- v0.6.1
- v0.6.0
- v0.5.0
- v0.4.2
- v0.4.1
- v0.4.0
- v0.3.1
- v0.3.0
- v0.2.4
- v0.2.3-alpha
- v0.2.2-alpha
- v0.2.1-alpha
- v0.2.0-alpha
- v0.1.2-alpha
- v0.1.1-alpha
- v0.1.0-alpha
Danet
Danet - Deno web framework.
- Modules - exactly what you think they are.
- Controllers - To handle requests.
- Dependency Injection - Let Danet take care of instantiating stuff for you when it is the most convenient.
- AuthGuards - Handle your Authentication/Authorization. The whole App get guard, Controllers get guard, Methods get guard, and you get a Guard…
- Decorators - Modules, Controllers, Method, Body, Query Params, do more with less code !
Roadmap
Task | State |
---|---|
Controllers and routes creation with Decorators (GET, PUT, DELETE, POST, PATCH) | Complete ✅ |
Module with dependency injection | Complete ✅ |
Request, Response and Body injection in Routes via decorators | Complete ✅ |
Route parameter decorator factory to easily create param decorators (even async) | Complete ✅ |
Url params injection in Controllers with Decorators | Complete ✅ |
Guards implementations for controllers and methods | Complete ✅ |
Global guard | Complete ✅ |
@Inject('token') to use with interfaces |
Complete ✅ |
Exceptions Filters | In progress ⌛ (ETA 15 May) |
Create documentation | In progress ⌛ (does it even end ?) |
Logger | Waiting |
Handle OPTIONS and HEAD | Waiting |
Anything we have in mind | Waiting |
Docs
Documentation will be available at https://sorikairox.github.io/Danet/
How to use
If you are familiar with Nest (and if you’re not, go check it out), you will not be lost.
In this simplified example, we are building a todo-app:
Modules
@Module({
controllers: [TodoController],
injectables: [TodoService]
})
class TodoModule {}
Controllers
@Controller('todo')
class TodoController {
//todoService will be automatically injected at runtime with DI
constructor(private todoService: TodoService) {
}
@Get('')
getTodos() {
return this.todoService.getTodos();
}
@Get(':id')
getOneTodo(@Param('id') todoId: string) {
return this.todoService.getOne(todoId);
}
@Post('')
createTodo(@Body() todo) {
return this.todoService.createTodo(todo);
}
@Put('')
UpdateTodos(@Body() updatedTodos: Todo[]) {
return this.todoService.updateMany(updatedTodos);
}
@Put(':id')
UpdateOneTodo(@Param('id') todoId: string, @Body() updatedTodo: Todo) {
return this.todoService.updateOneById(todoId, updatedTodo);
}
}
Services
//By default, injectables are singleton
@Injectable()
class TodoService {
//create your own DatabaseService to interact with db, it will be injected
constructor(databaseService: DatabaseService) {
}
getTodos() {
this.databaseService.getMany();
}
// implement your logic
}
Run your app
const optionalPort = 4000;
const app = new DanetApplication();
app.bootstrap(TodoModule);
await app.listen(optionalPort); //default to 3000