Skip to content
This repository has been archived by the owner on Jul 9, 2022. It is now read-only.

danawoodman/sveltekit-router

Repository files navigation

sveltekit-router

This is a VERY experimental proof of concept for a generic SvelteKit endpoint router that would allow you to do the following:

src/routes/api/[...path].ts:

import type { Routes } from './_router'

export const routes: Routes = {
  'GET /ping': async ({ request, params }) => ({ body: { request, params } }),
  'GET /users': async () => ({ body: { users: [] } }),
  'GET /users/:id': async ({ params }) => ({
    body: { user: { id: params.id } },
  }),
}

This is not something you should use (it's not even packaged yet), but might be informative for reference.o

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published