deploying react with vite
I've deployed a react app with vite, exposing network ip but I can't access it - says Application failed to respond on the url, i'm not sure what's wrong
33 Replies
Project ID:
6314f0f2-e1c1-471e-a5c2-4507a16c92b4
6314f0f2-e1c1-471e-a5c2-4507a16c92b4
i am using
"start": "tsc && vite --host 0.0.0.0 --port 3000"
in package.jsonthat starts a development server
copy the nixpacks.toml and Caddyfile from this repo into yours
https://github.com/brody192/vite-react-template
do i need to change any of the settings files
just copy those two files
i did it but the logs still say
I had a Dockerfile but I renamed it, so now the build fails
remove the dockerfile
I did
can you share your repo?
all .env stuff is public but sure https://github.com/traagel/creditstar-fe
🤣
i've been up all night trying to finish this job application homework, its 9 am and i would like to sleep
damn you're a hero
thanks 🙂
do you also know about flask deployment?
i have the
app.run(host="0.0.0.0", port=3000, debug=True)
but it also says application failed to respondwhats the python files name that has the flask app in it
perfect
your .env 😬
i know, i just wanted to get it working, it was supposed to be a 8 hour thing but now it's been like 3 days and i just want to get it done
add this as a railway.json file
add this as a .gitignore file
https://www.toptal.com/developers/gitignore/api/python
delete the .env file from the repo
delete the
__pycache__
from the repo
regen your database credentials from the settings menu of the database
and we can pick this back up tomorrow on how to setup database credentials properly and for use locally too, without the use of .env anywhere
forgot one thing, you will want to add gunicorn=21.2.0
to your requirements.txt file
and i assume you didnt have the database variables in the railway service variables so your app is very likely to crash upon startup
this is the log atm
kinda
in the railway.json file it should be
main:app
not main.app
my badhttps://creditstar-be-production.up.railway.app/
its up
god bless you
awsome!
One last thing, can you help me configure CORS? I already have it for python but i'm not sure how to do it for react
i have it as
CORS(app, resources={r"/api/*": {"origins": "*"}})
that should allow all origins
can you send me a link to where I would see this same error?
https://creditstar-fe-production.up.railway.app/ click on switch to sample user
oh nvm it works now, maybe it didn't refresh
I got a 404 on some unpaid_loans endpoint, but no cors errors
Ok great thank you so much, i can still submit it in time
😓 you really helped me out here
no problem!