package routes
#6661
Replies: 1 comment
-
I don't really know what I'm talking about, but it seems like you can do this now by creating your routing package, importing it in
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
routes folder is quickly building up and starting to get very cluttered.
It would be nice to have the ability to package a group of routes and be able to import them into a SvelteKit project like any other npm package. managing different group of routes as individual parts of the projects each with it's own repo etc.
concept example using express:
An express.js sub project (package) for user-auth:
npm i express
import { Router } from 'express';
router('/login', (req, res) => {})
router('/logout', (req, res) => {})
router('/signup', (req, res)=> {})
export default router;
An express.js main project (app) would then:
npm i user-auth
import auth from 'user-auth';
express.use('/auth', auth);
Now think SvelteKit instead of express.
it may make more sense to be part of the Package API of SvelteKit?
For example: if Svelte package would compile to a component library, then SvelteKit package would compile to a route library.
Or maybe not...
Either way, I think this will make it a lot easier to manage SvelteKit projects and even have more options provided by the open source community.
Beta Was this translation helpful? Give feedback.
All reactions