Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jonathan-foucher/hono-api-example
An example of API with Hono and Bun
https://github.com/jonathan-foucher/hono-api-example
bun hono sequelize typescript
Last synced: 17 days ago
JSON representation
An example of API with Hono and Bun
- Host: GitHub
- URL: https://github.com/jonathan-foucher/hono-api-example
- Owner: jonathan-foucher
- Created: 2024-11-02T19:55:24.000Z (2 months ago)
- Default Branch: master
- Last Pushed: 2024-11-02T21:37:45.000Z (2 months ago)
- Last Synced: 2024-11-10T02:42:57.740Z (about 2 months ago)
- Topics: bun, hono, sequelize, typescript
- Language: TypeScript
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Introduction
This project is an example of Hono API with Bun, sequelize and a postgres database.## Run the project
### Database
Install postgres locally or run it through docker with :
```
docker run -p 5432:5432 -e POSTGRES_DB=my_database -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres postgres
```### Dependencies
Install the project dependencies
```
bun i
```### Application
Once the postgres database is started and the dependencies installed, you can start the Hono project and try it out.Start the application
```
bun run dev
```Get all the movies
```
curl --location 'http://localhost:3000/api/movies'
```Save a movie
```
curl --request POST \
--url http://localhost:3000/api/movies \
--header 'Content-Type: application/json' \
--data '{
"id": 26,
"title": "Some movie title",
"release_date": "2022-02-26"
}'
```Delete a movie
```
curl --request DELETE \
--url http://localhost:3000/api/movies/26
```