move API routes as cleanup

This commit is contained in:
2023-07-22 13:08:41 +02:00
parent 9705509f54
commit e9339d4ba4
36 changed files with 482 additions and 35 deletions

View File

@@ -1,10 +1 @@
<script lang="ts">
import Header from "$lib/components/Header.svelte";
</script>
<Header>
<ul class=site_header slot=links>
<li><a href="/">Home</a></li>
</ul>
</Header>
<h1>WIP</h1>

View File

@@ -11,7 +11,7 @@ export const load: PageServerLoad = async ({ locals }) => {
export const actions: Actions = {
login: async (event) => {
const data = await event.request.formData()
const res = await event.fetch('/api/login',
const res = await event.fetch('/api/user/login',
{method: 'POST',
body: JSON.stringify({
username: data.get('username'),

View File

@@ -10,7 +10,7 @@ export const load: PageServerLoad = async ({ locals }) => {
export const actions: Actions = {
register: async (event) => {
const data = await event.request.formData();
const res = await event.fetch('/api/register',
const res = await event.fetch('/api/user/register',
{method: 'POST',
body: JSON.stringify({

View File

@@ -15,7 +15,7 @@ export const actions: Actions = {
},
login: async (event) => {
const data = await event.request.formData()
const res = await event.fetch('/api/login',
const res = await event.fetch('/api/user/login',
{method: 'POST',
body: JSON.stringify({
username: data.get('username'),