Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"db:migrate": "bun --bun drizzle-kit migrate"
},
"dependencies": {
"@elysiajs/openapi": "^1.4.11",
"drizzle-orm": "^0.44.7",
"drizzle-typebox": "^0.3.3",
"elysia": "latest",
Expand Down
19 changes: 18 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
import openapi, { fromTypes } from '@elysiajs/openapi';
import { Elysia } from 'elysia';
import { seriesModule } from './modules/series';

const app = new Elysia().use(seriesModule).listen(3000);
export const app = new Elysia()
.use(
openapi({
documentation: {
info: {
title: 'PNReST documentation',
description: 'REST API used by PNS softwares',
version: '0.0.0',
},
},
references: fromTypes(
process.env.NODE_ENV === 'production' ? 'dist/index.d.ts' : 'src/index.ts',
),
}),
)
.use(seriesModule)
.listen(3000);

console.log(`🦊 Elysia is running at ${app.server?.hostname}:${app.server?.port}`);
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
"types": [
"bun-types"
] /* Specify type package names to be included without being referenced in a source file. */,
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
Expand Down