Tutorial
Host REST API

Host Our Api

Add Pagination in Rest API

▶️ Railway

We are gonna use Railway for hosting our API. Railway is a free hosting platform for Node.js apps. It is very easy to use and has a very good documentation. You can host your API for free on Railway. You can also use other hosting platforms like Heroku, Vercel, etc.

  1. Visit Railway (opens in a new tab) and create an account.
  • First login to your Railway account and click on the New Project button.
  • Click on new project
  • Github Configuration
  • Select Github and choose the repository you want to deploy.
  • Select the branch you want to deploy.
  • Click on Deploy button.
  1. It takes some time to deploy your app.
  2. GO to Variables and add your MongoDB URI and your API key.
  3. Give a Name MONGODB_URL and paste your MongoDB URI in the Value field.
  4. Go to you mongodb ang go to Network Access and click on Add IP Address and add click on Allow Access from Anywhere.
  5. Go to settings and click on Generate Domain and copy the domain.