Closed cilki closed 6 years ago
So are we going to move the static files to S3 and hook it all up with Route53 for production? Or will we be using flask and npm server
on the EC2 instance at the same time?
Not that it matters too much, just curious
What does npm server
actually do? If it just serves up the bundled js file, then I guess it's equivalent to hosting the bundle on S3 with the appropriate DNS configuration.
it doesn't do anything right now. It’s pretty easy to get it to start a static file server serving the html/js/etc files though. I will set it up tomorrow
This is halfway complete. All that's left is to setup the node server. Here's what I tried:
FROM node:latest
WORKDIR /app
RUN npm install http-server -g
EXPOSE 80
CMD npm install && npm run build && http-server /app -p 80
But the server just lists directory contents. How do we get it to actually load the JS?
Did you put index.html in the /app folder? You have to run http-server
in the same folder as the index.html file is
And then make sure the path in index.html to bundle.js is relative to that location
Got it working. Also you won't need to run the backend anymore because it will be stable at api.gameframe.online
pretty soon. I'll make an entry npm start
in package.json to run the frontend.
Currently the frontend is served through Flask which is not optimal. We need to separate the two components so they work independently.
npm server
ornpm http-server
or something else to host the frontendmain.py