https://github.com/restyjs/resty
A Node.js framework
https://github.com/restyjs/resty
decorators dependency-injection express hacktoberfest nodejs simple typedi typescript
Last synced: 5 days ago
JSON representation
A Node.js framework
- Host: GitHub
- URL: https://github.com/restyjs/resty
- Owner: restyjs
- License: mit
- Created: 2019-05-29T08:47:52.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-13T21:44:45.000Z (about 3 years ago)
- Last Synced: 2025-08-30T11:58:19.507Z (7 months ago)
- Topics: decorators, dependency-injection, express, hacktoberfest, nodejs, simple, typedi, typescript
- Language: TypeScript
- Homepage: https://www.npmjs.com/org/restyjs
- Size: 1.58 MB
- Stars: 28
- Watchers: 2
- Forks: 3
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# Resty.js
> A modern, lightweight, and type-safe framework for building server-side applications with Node.js and TypeScript.
Resty.js provides a robust set of decorators and tools to build scalable APIs quickly. It integrates seamlessly with Express.js while offering a superior developer experience with Dependency Injection, declarative routing, and built-in production best practices.
## Features
- **Type-Safe**: Built with TypeScript for TypeScript.
- **Declarative Routing**: Use decorators like `@Controller`, `@Get`, `@Post` to define your API.
- **Dependency Injection**: Built-in DI container powered by `typedi`.
- **Developer Experience**:
- 🚀 **CLI**: `resty dev` for instant hot-reloading.
- 🛠**VS Code Extension**: Snippets for faster coding.
- 📦 **Modular**: Core is lightweight; optional packages for CLI, specific integrations.
- **Production Ready**:
- Security headers (Helmet)
- CORS support
- Compression
- Graceful Shutdown
- Context-aware Request ID
## Installation
```bash
npm install @restyjs/core reflect-metadata
npm install -D @restyjs/cli typescript
```
## Quick Start
Create a `src/index.ts` file:
```typescript
import "reflect-metadata";
import { resty, Controller, Get } from "@restyjs/core";
@Controller("/hello")
class HelloController {
@Get("/")
index() {
return { message: "Hello World" };
}
}
const app = resty({
controllers: [HelloController],
});
app.listen(3000, () => {
console.log("Server started on http://localhost:3000");
});
```
Run it with hot reload:
```bash
npx resty dev
```
## Documentation
Visit our [Documentation Site](https://restyjs.com) (coming soon) or browse `packages/docs`.
## Examples
Check out the [examples](./examples) directory:
- [Basic](./examples/basic): Minimal setup.
- [CRUD](./examples/crud): Full CRUD with Service layer and Dependency Injection.
## License
MIT