-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
201 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,68 @@ | ||
# Alwatr Nanotron Api Server | ||
## Nanotron | ||
|
||
Nanotron: Your Lightweight, High-Performance Micro/Nano Service Framework. | ||
**Your Lightweight, High-Performance Micro/Nano Service Framework** | ||
|
||
Nanotron is designed for building blazingly fast and efficient microservices and APIs. Its minimalist approach and focus on performance make it ideal for resource-constrained environments and scenarios where every millisecond counts. | ||
|
||
## Key Features | ||
|
||
- **Lightweight:** Minimal dependencies and a small footprint ensure optimal performance. | ||
- **High-Performance:** Optimized for speed and efficiency in handling requests. | ||
- **Microservice-Friendly:** Perfect for building and managing microservices architectures. | ||
- **Intuitive API:** Simple and easy-to-use API for defining routes and handling requests. | ||
- **TypeScript Support:** Built with TypeScript for enhanced type safety and developer experience. | ||
|
||
## Installation | ||
|
||
```bash | ||
npm install @alwatr/nanotron | ||
``` | ||
|
||
## Getting Started | ||
|
||
```js | ||
import { NanotronApiServer } from '@alwatr/nanotron'; | ||
|
||
const apiServer = new NanotronApiServer({ | ||
host: '0.0.0.0', | ||
port: 80, | ||
prefix: '/api/', | ||
}); | ||
|
||
apiServer.defineRoute({ | ||
method: 'GET', | ||
url: '/hello', | ||
handler() { | ||
this.serverResponse.replyJson({ | ||
ok: true, | ||
message: 'Hello :)', | ||
}); | ||
} | ||
}); | ||
|
||
apiServer.defineRoute({ | ||
method: 'POST', | ||
url: '/echo-body', | ||
async handler() { | ||
const body = await this.getBodyRaw(); | ||
this.serverResponse.replyJson({ | ||
ok: true, | ||
data: body.toString(), | ||
}); | ||
} | ||
}); | ||
``` | ||
|
||
## Sponsors | ||
|
||
The following companies, organizations, and individuals support Nitrobase ongoing maintenance and development. Become a Sponsor to get your logo on our README and website. | ||
|
||
[![Exir Studio](https://avatars.githubusercontent.com/u/181194967?s=200&v=4)](https://exirstudio.com) | ||
|
||
## License | ||
|
||
This project is licensed under the AGPL-3.0 License. | ||
|
||
## Contributing | ||
|
||
Contributions are welcome! Please feel free to submit issues and pull requests. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,68 @@ | ||
# Alwatr Nanotron Api Server | ||
## Nanotron API Server | ||
|
||
Nanotron: Your Lightweight, High-Performance Micro/Nano Service Framework. | ||
**Your Lightweight, High-Performance Micro/Nano Service Framework** | ||
|
||
Nanotron is designed for building blazingly fast and efficient microservices and APIs. Its minimalist approach and focus on performance make it ideal for resource-constrained environments and scenarios where every millisecond counts. | ||
|
||
## Key Features | ||
|
||
- **Lightweight:** Minimal dependencies and a small footprint ensure optimal performance. | ||
- **High-Performance:** Optimized for speed and efficiency in handling requests. | ||
- **Microservice-Friendly:** Perfect for building and managing microservices architectures. | ||
- **Intuitive API:** Simple and easy-to-use API for defining routes and handling requests. | ||
- **TypeScript Support:** Built with TypeScript for enhanced type safety and developer experience. | ||
|
||
## Installation | ||
|
||
```bash | ||
npm install @alwatr/nanotron | ||
``` | ||
|
||
## Getting Started | ||
|
||
```js | ||
import { NanotronApiServer } from '@alwatr/nanotron'; | ||
|
||
const apiServer = new NanotronApiServer({ | ||
host: '0.0.0.0', | ||
port: 80, | ||
prefix: '/api/', | ||
}); | ||
|
||
apiServer.defineRoute({ | ||
method: 'GET', | ||
url: '/hello', | ||
handler() { | ||
this.serverResponse.replyJson({ | ||
ok: true, | ||
message: 'Hello :)', | ||
}); | ||
} | ||
}); | ||
|
||
apiServer.defineRoute({ | ||
method: 'POST', | ||
url: '/echo-body', | ||
async handler() { | ||
const body = await this.getBodyRaw(); | ||
this.serverResponse.replyJson({ | ||
ok: true, | ||
data: body.toString(), | ||
}); | ||
} | ||
}); | ||
``` | ||
|
||
## Sponsors | ||
|
||
The following companies, organizations, and individuals support Nitrobase ongoing maintenance and development. Become a Sponsor to get your logo on our README and website. | ||
|
||
[![Exir Studio](https://avatars.githubusercontent.com/u/181194967?s=200&v=4)](https://exirstudio.com) | ||
|
||
## License | ||
|
||
This project is licensed under the AGPL-3.0 License. | ||
|
||
## Contributing | ||
|
||
Contributions are welcome! Please feel free to submit issues and pull requests. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,68 @@ | ||
# Alwatr Nanotron Api Server | ||
## Nanotron | ||
|
||
Nanotron: Your Lightweight, High-Performance Micro/Nano Service Framework. | ||
**Your Lightweight, High-Performance Micro/Nano Service Framework** | ||
|
||
Nanotron is designed for building blazingly fast and efficient microservices and APIs. Its minimalist approach and focus on performance make it ideal for resource-constrained environments and scenarios where every millisecond counts. | ||
|
||
## Key Features | ||
|
||
- **Lightweight:** Minimal dependencies and a small footprint ensure optimal performance. | ||
- **High-Performance:** Optimized for speed and efficiency in handling requests. | ||
- **Microservice-Friendly:** Perfect for building and managing microservices architectures. | ||
- **Intuitive API:** Simple and easy-to-use API for defining routes and handling requests. | ||
- **TypeScript Support:** Built with TypeScript for enhanced type safety and developer experience. | ||
|
||
## Installation | ||
|
||
```bash | ||
npm install @alwatr/nanotron | ||
``` | ||
|
||
## Getting Started | ||
|
||
```js | ||
import { NanotronApiServer } from '@alwatr/nanotron'; | ||
|
||
const apiServer = new NanotronApiServer({ | ||
host: '0.0.0.0', | ||
port: 80, | ||
prefix: '/api/', | ||
}); | ||
|
||
apiServer.defineRoute({ | ||
method: 'GET', | ||
url: '/hello', | ||
handler() { | ||
this.serverResponse.replyJson({ | ||
ok: true, | ||
message: 'Hello :)', | ||
}); | ||
} | ||
}); | ||
|
||
apiServer.defineRoute({ | ||
method: 'POST', | ||
url: '/echo-body', | ||
async handler() { | ||
const body = await this.getBodyRaw(); | ||
this.serverResponse.replyJson({ | ||
ok: true, | ||
data: body.toString(), | ||
}); | ||
} | ||
}); | ||
``` | ||
|
||
## Sponsors | ||
|
||
The following companies, organizations, and individuals support Nitrobase ongoing maintenance and development. Become a Sponsor to get your logo on our README and website. | ||
|
||
[![Exir Studio](https://avatars.githubusercontent.com/u/181194967?s=200&v=4)](https://exirstudio.com) | ||
|
||
## License | ||
|
||
This project is licensed under the AGPL-3.0 License. | ||
|
||
## Contributing | ||
|
||
Contributions are welcome! Please feel free to submit issues and pull requests. |