create-velox-app 0.3.3 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/templates.js +6 -6
- package/package.json +1 -1
package/dist/templates.js
CHANGED
|
@@ -221,10 +221,10 @@ import 'dotenv/config';
|
|
|
221
221
|
|
|
222
222
|
import fastifyStatic from '@fastify/static';
|
|
223
223
|
import {
|
|
224
|
-
|
|
224
|
+
veloxApp,
|
|
225
225
|
VELOX_VERSION,
|
|
226
|
-
|
|
227
|
-
|
|
226
|
+
databasePlugin,
|
|
227
|
+
rest,
|
|
228
228
|
getRouteSummary,
|
|
229
229
|
} from '@veloxts/velox';
|
|
230
230
|
import path from 'node:path';
|
|
@@ -238,14 +238,14 @@ import { healthProcedures, userProcedures } from './procedures/index.js';
|
|
|
238
238
|
// ============================================================================
|
|
239
239
|
|
|
240
240
|
async function createApp() {
|
|
241
|
-
const app = await
|
|
241
|
+
const app = await veloxApp({
|
|
242
242
|
port: config.port,
|
|
243
243
|
host: config.host,
|
|
244
244
|
logger: config.logger,
|
|
245
245
|
});
|
|
246
246
|
|
|
247
247
|
// Register database plugin
|
|
248
|
-
await app.
|
|
248
|
+
await app.register(databasePlugin({ client: prisma }));
|
|
249
249
|
|
|
250
250
|
// Register static file serving for frontend
|
|
251
251
|
await app.server.register(fastifyStatic, {
|
|
@@ -255,7 +255,7 @@ async function createApp() {
|
|
|
255
255
|
|
|
256
256
|
// Register REST API routes
|
|
257
257
|
const collections = [userProcedures, healthProcedures];
|
|
258
|
-
app.routes(
|
|
258
|
+
app.routes(rest(collections, { prefix: config.apiPrefix }));
|
|
259
259
|
|
|
260
260
|
return { app, collections };
|
|
261
261
|
}
|