英文:
Where to keep helpers code and types for Remix
问题
我是新手使用 Remix 并开始一些开发工作。由于app
目录中的所有代码基本上都像路由一样运行,如果我在app
目录中创建一个helpers
文件夹,并在其中包含辅助函数(使用TypeScript,.ts文件),我不一定希望将该代码暴露为路由。
我还想为我的所有类型创建一个文件夹或文件。
那么我应该把它们放在哪里,以便它们不成为路由?
英文:
I'm new to Remix and beginning some development with it. Since all code in the app
directory essentially behaves like a router, if I were to make a helpers
folder in app along with helper functions inside (using TypeScript, .ts files), I wouldn't necessarily want that code exposed as a route.
I also want to have a folder or file for all my types.
So where do I put them, so they are not a route?
答案1
得分: 0
只意识到在 app
下有 routes
文件夹,因此我可以将我的辅助代码和类型放在 app
内,但不在路由之内,从而实现我想要的。
英文:
Duh! Just realized that under app
is the routes
folder, hence I can place my helpers code and types under app
but outside of routes and therefore achieve what I wanted.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论