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?