diff --git a/.gitignore b/.gitignore index 3c3629e..37d7e73 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ node_modules +.env diff --git a/bun.lockb b/bun.lockb index 624e4d5..0ece36a 100644 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index ac521f0..583df16 100644 --- a/package.json +++ b/package.json @@ -1,23 +1,23 @@ { - "name": "email-microservice", - "private": true, - "type": "module", - "scripts": { - "dev": "bun --watch src/index.ts", - "start": "bun src/index.ts" - }, - "dependencies": { - "@hono/node-server": "^1.3.3", - "@hono/swagger-ui": "^0.2.1", - "@hono/zod-openapi": "^0.9.5", - "@hono/zod-validator": "^0.1.11", - "bullmq": "^5.1.1", - "hono": "^4.0.0", - "ioredis": "^5.3.2", - "zod": "^3.22.4" - }, - "devDependencies": { - "@types/node": "^20.10.4", - "bun-types": "latest" - } -} \ No newline at end of file + "name": "email-microservice", + "private": true, + "type": "module", + "scripts": { + "dev": "bun --watch src/index.ts", + "start": "bun src/index.ts" + }, + "dependencies": { + "@hono/node-server": "1.13.7", + "@hono/swagger-ui": "0.4.1", + "@hono/zod-openapi": "0.18.0", + "@hono/zod-validator": "0.4.1", + "bullmq": "5.28.1", + "hono": "4.6.11", + "ioredis": "5.4.1", + "zod": "3.23.8" + }, + "devDependencies": { + "@types/node": "22.9.1", + "bun-types": "1.1.36" + } +} diff --git a/src/index.ts b/src/index.ts index 69e5b21..6e405f9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -10,6 +10,7 @@ app.use('*', logger()) app.use('*', prettyJSON()) app.route('/api/v1/email', emailRouter) +app.get('/docs', createSwaggerUI()) app.get('/swagger', createSwaggerUI()) const port = process.env.PORT || 3000 diff --git a/src/swagger.ts b/src/swagger.ts index 764f06e..4fc495f 100644 --- a/src/swagger.ts +++ b/src/swagger.ts @@ -1,8 +1,5 @@ -import { OpenAPIHono } from '@hono/zod-openapi' import { swaggerUI } from '@hono/swagger-ui' -const openapi = new OpenAPIHono() - const routes = { '/api/v1/email': { post: {