Compare commits

..

2 Commits

Author SHA1 Message Date
7e835af3f2 changelog 2021-05-08 10:17:20 +02:00
f153102978 bug 2021-05-08 10:16:05 +02:00
4 changed files with 14 additions and 5 deletions

View File

@@ -1 +1,2 @@
target
node_modules

View File

@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.0.9] - 2021-05-08
### Fixed
- API endpoint was not reachable
## [1.0.9] - 2021-05-07
## Changed

View File

@@ -23,4 +23,6 @@ COPY --from=CLIENT /tmp/build ./client/build
ENV MEMCACHE=memcached:11211
EXPOSE 5000
ENTRYPOINT [ "/app/cryptgeon" ]

View File

@@ -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