-
Notifications
You must be signed in to change notification settings - Fork 596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Routing Client Side/Packaging for Deployment #676
Comments
This is expected. Any route request are handled by the server choo, as a front end framework, can't do anything about that. What you need to do is redirect any static route to the route where your choo app lives. |
@YerkoPalma, can you explain this in a bit more detail or point me to some docs where I can find out how to do this? Thanks! |
@m-onz I guess this is expected behavior! |
@AcidLeroy the python simpleHTTPServer knows to rewrite the route At my work we use Caddy with its built-in rewrite directive for this purpose. Any full-featured HTTP server (nginx, Apache, etc.) can accomplish this. |
You can direct the user to a a route like var http = require('http')
http.createServer(function (req, res) {
if(req.url.startsWith('/homer')) {
... |
There is an ongoing discussion over at http-party/http-server#757 (comment) What I am looking for primarily is
|
Expected behavior
I've written some routes that are not behaving as expected. I initially started off with the
create-choo-app
scaffolding; however, that required turned out to only be a good idea for development. When it came to deployment, my dynamic routes were all broken when I tried to push up mydist
folder to s3 (where I am going to eventually host my choo site). So rather than use the fancy bankai package, I thought I would use browserify to get everything working. Again, this caused all my routes to break. Am I missing something, or do you have to run something like budo or bankai in order to serve the page up? Here is basically what I am doing:index.html:
index.js
browserify command:
When I run a simple http server like
python -m simpleHttpServer 8000
my initial route comes up fine. But then if I attempt to typelocalhost:8000/homer
into the address bar I get a 404 error.I would expect that I should get "placeholder".
I guess ultimately my question is how do I get everything nice and packaged in the browser so that I can manually type routes in the address bar and get the results I am anticipating? Thanks!
The text was updated successfully, but these errors were encountered: