1. 5
    Remix Server Code Filename Convention
    1m 3s

Remix Server Code Filename Convention

InstructorKent C. Dodds

Share this video with your friends

Send Tweet

While you technically can have server functions in your route files, it’s not always the best choice.

For code that you never ever want in your client, it’s a best practice to move them into separate files, and name with the .server convention. For example: posts.server.ts

Kent C. Doddsinstructor
~ 2 years ago

Note that you can absolutely interact with the database directly in your loader within your route module. I just find that it's typically better from a code organization standpoint to put all database interactions in a separate module.