-
Hi all, We have a Remix app and want to start exposing some data via an API, to be consumed by third party users. Things we know we will want:
My question is - what would be better, using remix resource routes (remix pages with just loaders and actions), or should I just convert our remix app to run on top of an express server, and define API routes, middleware etc. there? (Currently, its just a remix app server, so don't have a server.js file). Has anyone built an API on top of remix yet? Let me know your thoughts! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I think the only possible advantage of Express over Remix would be that you can leverage lots of already built and tested middlewares and tutorials, because at the core Express is just a router and Remix also gives you that. A benefit of using Remix though could be to allow the deploy of your API to any server or Serverless or edge platform Remix support while using Express you will be limited to platforms supporting Node. Additionally, if you have not only an API but also a web app built with Remix by putting the API in the Remix app too you could share code between them, so your web doesn’t need to fetch the API and it could call functions to get the data instead. |
Beta Was this translation helpful? Give feedback.
I think the only possible advantage of Express over Remix would be that you can leverage lots of already built and tested middlewares and tutorials, because at the core Express is just a router and Remix also gives you that.
A benefit of using Remix though could be to allow the deploy of your API to any server or Serverless or edge platform Remix support while using Express you will be limited to platforms supporting Node.
Additionally, if you have not only an API but also a web app built with Remix by putting the API in the Remix app too you could share code between them, so your web doesn’t need to fetch the API and it could call functions to get the data instead.