I have no experience with web hosting and I've been trying for days to get my (Spring Boot + Angular) app up and running. Please help!
I can't figure out the routing of requests. Here is the structure of my server app:
src
main
appengine
app.yaml
java
resources
pom.xml
I use maven-resources-plugin to ng build and copy my frontend (which is in a different folder) into ${basedir}/target/classes/static when I deploy my app.
Now here are my app.yaml handlers:
handlers:
# Direct these to the server's endpoints
- url: /api/.*
script: auto
# Direct these to index.html and let the frontend routes do their thing
- url: /.*
static_files: static/front/index.html # this does not work
upload: static/front/index.html # this does not work
At the moment when I try to reach mywebsite.com/some-page, the request is routed to my server and, since the /some-page endpoint doesn't exist, I get the "The requested URL / was not found on this server" error (and "Static file referenced by handler not found" in the server logs).
My question is, what path should I put in static_files here, so that my requests that don't contain /api/ don't all get routed to the server app?
Furthermore I tried moving app.yaml to the project root to make this easier but deployment (mvn package appengine:deploy) fails because it doesn't find the file /src/main/appengine/app.yaml.
Edit: For what it's worth, here's the location of index.html when I explore the JAR:
my-website.jar
META-INF
BOOT-INF
classes
com
purrfectdoodle
back
service <----------- These are the project packages
model
repository
...
static
front
index.html <---------- HERE