Setup elysia swagger

This commit is contained in:
Zoe Roux 2024-10-24 21:33:56 +02:00
parent 9e4076e1ea
commit ad8673a46f
No known key found for this signature in database
3 changed files with 10 additions and 44 deletions

42
api/.gitignore vendored
View File

@ -1,42 +1,2 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# next.js
/.next/
/out/
# production
/build
# misc
.DS_Store
*.pem
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local
# vercel
.vercel
**/*.trace
**/*.zip
**/*.tar.gz
**/*.tgz
**/*.log
package-lock.json
node_modules
**/*.bun

View File

@ -0,0 +1,2 @@
export const EntriesController = new Elysia()
.get('/entries', () => "hello");

View File

@ -1,5 +1,9 @@
import { Elysia } from "elysia";
import { swagger } from "@elysiajs/swagger";
const app = new Elysia().get("/", () => "Hello Elysia").listen(3000);
const app = new Elysia()
.use(swagger())
.get("/", () => "Hello Elysia")
.listen(3000);
console.log(`🦊 Elysia is running at ${app.server?.hostname}:${app.server?.port}`);
console.log(`Api running at ${app.server?.hostname}:${app.server?.port}`);