bun api starter
1.0.0
Elysiajs 프레임 워크를 사용하여 구축 된 강력한 BUN 기반 API 스타터 및 MongoDB를 데이터베이스로 만들었습니다. Elysiajs, 유형-안전 및 빠른 프레임 워크. 강력한 NOSQL 데이터베이스 인 MongoDB. 이 스타터는 API 개발을위한 탄탄한 기반을 제공하여 고유 한 비즈니스 논리에 집중할 수 있습니다.
롤빵 및 스타터 패키지를 설치하려면
curl -fsSL https://bun.sh/install | bash
bun install개발 서버 실행을 시작하려면 :
$ bun run dev
Environment: development
Bun (?) API Starter is running at localhost:8000
Info: MongoDB connection successful: starterhttp : // localhost : 8000/docs를 개방하여 결과를 확인하십시오.
curl --request POST
--url http://localhost:8000/login
--header ' Content-Type: application/json '
--data ' {
"email": "[email protected]",
"password": "secret@123"
} ' # development
$ docker compose up -d dev
[+] Running 2/3
⠋ Network bun-api-starter_default Created 1.0s
✔ Container starter-mongodb Started 0.5s
✔ Container starter-dev Started 0.9s
# check logs
$ docker compose logs -f # production
docker build --target production -t bun-api-starter-prod .
docker run -d --rm --env-file .env.docker
-p 8080:8000
-t bun-api-starter-prod:latest # connect URI for root user.
mongodb://rootuser:root%40123@localhost:27017/starter ? authSource=admin # on default export error
const app = new Elysia ();
export default app ;
# double bun server initiated.
$ Bun (?) API Starter is running at localhost:8000
Started server http://localhost:3000
# do this
export const app = new Elysia (); // exception not captured onError.
function controller ( context : Context ) { }
// do this
const controller = ( context : Context ) => { } @cham11ng