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/* \