diff --git a/backend/src/main/kotlin/no/nav/helse/sprik/plugins/Routing.kt b/backend/src/main/kotlin/no/nav/helse/sprik/plugins/Routing.kt index de18b2f..3f258fe 100644 --- a/backend/src/main/kotlin/no/nav/helse/sprik/plugins/Routing.kt +++ b/backend/src/main/kotlin/no/nav/helse/sprik/plugins/Routing.kt @@ -44,11 +44,14 @@ fun configureRouting(): ApplicationEngine = embeddedServer(CIO, applicationEngin get("/isready"){ call.respondText("READY") } + get("/api/test") { + call.respondText("test") + } post("/test") { val test = call.receive() call.respond(status = HttpStatusCode.Created, message = test) } - post("/nyfeil") { + post("/api/nyfeil") { val feilmelding = call.receive() feilmeldingRepository.lagre(feilmelding) call.respond(status = HttpStatusCode.Created, message = "Feilmelding motatt og sendt til database") diff --git a/backend/src/test/kotlin/LocalApp.kt.kt b/backend/src/test/kotlin/LocalApp.kt.kt new file mode 100644 index 0000000..88b5ced --- /dev/null +++ b/backend/src/test/kotlin/LocalApp.kt.kt @@ -0,0 +1,13 @@ +import no.nav.helse.sprik.Application +import no.nav.helse.sprik.configureFlyway +import no.nav.helse.sprik.db.Database +import no.nav.helse.sprik.dbconfig + + +fun main() { + + val db = Database(dbconfig()).configureFlyway() + val app = Application(db) + + app.startBlocking() +} diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 5a33944..210cde2 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -4,4 +4,13 @@ import react from '@vitejs/plugin-react' // https://vitejs.dev/config/ export default defineConfig({ plugins: [react()], + server: { + headers: {}, + proxy: { + '/api': { + target: 'http://localhost:8080', + changeOrigin: true, + }, + }, + }, })