From f153102978302f365507417aeaf1fc709fd02910 Mon Sep 17 00:00:00 2001 From: cupcakearmy Date: Sat, 8 May 2021 10:16:05 +0200 Subject: [PATCH] bug --- .dockerignore | 3 ++- Dockerfile | 2 ++ client/src/lib/api.ts | 8 ++++---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.dockerignore b/.dockerignore index 1de5659..5feb907 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1 +1,2 @@ -target \ No newline at end of file +target +node_modules \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 12296b6..2621330 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,4 +23,6 @@ COPY --from=CLIENT /tmp/build ./client/build ENV MEMCACHE=memcached:11211 +EXPOSE 5000 + ENTRYPOINT [ "/app/cryptgeon" ] \ No newline at end of file diff --git a/client/src/lib/api.ts b/client/src/lib/api.ts index e006ffe..943f078 100644 --- a/client/src/lib/api.ts +++ b/client/src/lib/api.ts @@ -13,7 +13,7 @@ type CallOptions = { method: string body?: any } -const base = dev ? 'http://localhost:5000' : undefined +const base = dev ? 'http://localhost:5000/api/' : '/api/' async function call(options: CallOptions) { return fetch(base + options.url, { method: options.method, @@ -27,7 +27,7 @@ async function call(options: CallOptions) { export async function create(note: Note) { const data = await call({ - url: '/api/notes', + url: 'notes', method: 'post', body: note, }) @@ -36,7 +36,7 @@ export async function create(note: Note) { export async function get(id: string) { const data = await call({ - url: `/api/notes/${id}`, + url: `notes/${id}`, method: 'delete', }) return data as NotePublic @@ -44,7 +44,7 @@ export async function get(id: string) { export async function info(id: string) { const data = await call({ - url: `/api/notes/${id}`, + url: `notes/${id}`, method: 'get', }) return data as NoteInfo