Deploy React & Node Express App Online in Minutes with Railway (No Credit Card Needed)

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 พ.ย. 2024

ความคิดเห็น • 14

  • @AriSyuhada
    @AriSyuhada ปีที่แล้ว +3

    Hi, I've deployed two stuff on railway, the first one is ruby on rail that serve as backend api and websocket cable connection server, and the other hand is react + vite as frontend app. The first one is successfully deployed. but the react + vite app is not. The first thing I did is just like you, straight adding the project right outta the github repo, but it gives me error the first time, caused by that is the deploy command is empty. Then, I try some work around like npm run dev, run serve, or run preview, those command work well on the railway, but it gives port 5173 and host 'localhost'. how can i access my frontend app? it doesn't show on generated domain. thx

  • @rahulagarwal968
    @rahulagarwal968 ปีที่แล้ว +3

    If you have Mongodb or PostgreSQL database. Then where do you prefer database to host ?

    • @OganicaBean
      @OganicaBean ปีที่แล้ว +1

      I have the same question.

  • @emmanuelgirault2332
    @emmanuelgirault2332 ปีที่แล้ว +1

    I've deployed my backend successfully on Railway. Now I want to do the same with my React/Vite frontend. The difference with this video, is that you have to specify the build command (npm run build), but also a start command. I don't know what to put on a start command. Previously the frontend was on Render, I just had to specify the directory (so, /dist).

    • @anudeep9683
      @anudeep9683 ปีที่แล้ว

      Hey bud did you get around the issue

    • @thefireagen
      @thefireagen 10 หลายเดือนก่อน

      This might the issue for you
      "start": "npx http-server ./dist",
      But the problem.. the content is not served in this case. I copied it from the frontend repo package.json

    • @gabrielmessner7008
      @gabrielmessner7008 9 หลายเดือนก่อน

      I have the same problem.. Did you find a solution?

    • @adityabv6448
      @adityabv6448 3 หลายเดือนก่อน

      You need to configure caddy.
      search for "react vite deployment in railway" in google. Install that given repo and copy the caddy file and cady.toml file from that example repo to your repo

    • @Anon-h3q
      @Anon-h3q 16 วันที่ผ่านมา

      same thins

  • @lautarocastro4483
    @lautarocastro4483 ปีที่แล้ว

    Great video man, thanks!

  • @bmp713
    @bmp713 ปีที่แล้ว

    What does it mean if your Express API works perfectly on localhost but when you deploy to Railway it gives the error
    ""Cannot GET /read"?

    • @ehhh-07
      @ehhh-07 10 หลายเดือนก่อน

      It means server is running get on that api end point is not fetching anything . Add proper route to the end point

  • @sandyarfian1296
    @sandyarfian1296 11 หลายเดือนก่อน

    terimakasih informasinya bang