using ruby on rails for running locally.
using vercel serverless functions for deployment.
why not just deploy the ror? I've tried and I don't think vercel supports this.
have I tried other free hosting platform? no.
/ror
to run locally/vercel
to deploy/vercel/functions
to hold the controllers used by both the ror and vercel (it was only/functions
before, but I had to move it to/vercel/functions
to make it work with vercel serverless)
to run locally, run rails s
in the ror directolry (stands for ruby on rails)
(install using bundler, bundle install
. from the directory with the Gemfile
. its like npm install with package.json
)
]
to run the front end, go to solid front and run npm install
then npm run dev
-
local: each file in
vercel/api
serve as individual endpoints -
server: to add route in the local server, add to
config/routes.rb
and the function inror/app/controllers/application_controller.rb
-
do the function inside
functions
folder.
you must do all 3 to add an endpoint.
- you might want to use
rbenv
for managing ruby versions. vercel uses ruby3.2.0
. at the time of writing, the latest version is3.3.0