Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

I'm trying to call a svelte route through a url in the browser. It give me a 404

$
0
0

I am trying to use a svelte app to call an api route. I made a simple svelte app with npm init svelte@next svelte-api-calling. I added the file routes/api/callthis/[name].ts, and it looks like this:

export async function get({ params }) {    const {name} = params;    console.log(name);};

I start the app with npm run dev. I tried to call this api route by typing http://localhost:5173/api/callthis/check into my browser. I expected my console to log check. It gave me a 404 error. How do I get this route to work?


Viewing all articles
Browse latest Browse all 1541

Trending Articles