1

I'm trying to create a dedicated health check route that uses a different port (3001) in Rails 5. my route should just render the text response "Up and running" but use a port different to the default app port while the app runs on the default port as usual.

def healthcheck
  render plain: 'Up and running'
end  

Thanks for the help!

2 Answers2

0

Have you tried to run rails s -p 3001 ?

0

You can change the port by editing your config/puma.rb file. You’re looking for this line:

port ENV.fetch(“PORT”) { 3000 }

Change the 3000 to the port you want to use.

hashrocket
  • 2,210
  • 1
  • 16
  • 25