From 1235b288b496a625d7bc766540fd1f3215018106 Mon Sep 17 00:00:00 2001 From: ringeringeraja Date: Wed, 12 Jun 2024 03:03:50 -0300 Subject: [PATCH] chore: `npm install` -> `npm ci` in Dockerfile --- api/Dockerfile | 2 +- api/src/routes/index.ts | 13 +++++++++++-- web/Dockerfile | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/api/Dockerfile b/api/Dockerfile index 5aa32c6..53f6ef3 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -3,7 +3,7 @@ FROM node:20 WORKDIR /opt/application/api COPY . . -RUN npm install +RUN npm ci RUN npm run build CMD npm run build:post \ diff --git a/api/src/routes/index.ts b/api/src/routes/index.ts index 8d00137..423f290 100644 --- a/api/src/routes/index.ts +++ b/api/src/routes/index.ts @@ -1,10 +1,19 @@ -import { createRouter } from 'aeria' +import { createRouter, Result } from 'aeria' export const router = createRouter() -router.GET('/test', () => { +router.GET('/test', async (context) => { + const { error, result } = await context.collections.person.functions.get({ + filters: {} + }) + + if( error ) { + return Result.error(error) + } + return { message: 'Hello, world!', + result, } }) diff --git a/web/Dockerfile b/web/Dockerfile index ef7519e..edd2270 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -2,7 +2,7 @@ FROM node:20 WORKDIR /opt/application/web COPY . . -RUN npm install +RUN npm ci CMD cp ../api/node_modules/aeria-sdk/dist/runtime.* node_modules/aeria-sdk/dist \ && npm run build \ && rm -rf /var/www/html/* \