Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/digital-alchemy-ts/fastify
https://github.com/digital-alchemy-ts/fastify
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/digital-alchemy-ts/fastify
- Owner: Digital-Alchemy-TS
- License: mit
- Created: 2024-03-10T04:14:23.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-11-18T11:44:37.000Z (2 months ago)
- Last Synced: 2024-11-21T03:56:16.441Z (2 months ago)
- Language: TypeScript
- Homepage: https://docs.digital-alchemy.app
- Size: 804 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# 📨 Welcome to the Fastify Adapter Library
- [Extended docs](https://docs.digital-alchemy.app)
- [Discord](https://discord.gg/JkZ35Gv97Y)This library acts as a simple wrapper for Fastify, allowing it to be configured and loaded by @digital-alchemy workflows
## 🥡 Import Code
Add as a dependency, and add to your imports. Nice and easy
```bash
npm i @digital-alchemy/fastify-extension
```> **Add to code**
```typescript
import { LIB_FASTIFY } from "@digital-alchemy/fastify-extension";// application
const MY_APP = CreateApplication({
libraries: [LIB_FASTIFY],
name: "home_automation",
})// library
export const MY_LIBRARY = CreateLibrary({
depends: [LIB_FASTIFY],
name: "special_logic",
})
```## 🧲 Usage
```typescript
export function Example({ fastify }: TServiceParams) {
fastify.routes((fastify: FastifyInstance) => {
fastify.post("/a", () => { /*...*/ });
fastify.get("/b", () => { /*...*/ });
});
}
```