choojs / bankai

:station: - friendly web compiler
Apache License 2.0
1.09k stars 102 forks source link

Question: Deployment On AWS #507

Closed AcidLeroy closed 6 years ago

AcidLeroy commented 6 years ago

I've been happily building and testing locally with bankai using the create-choo-app CLI tool. It's finally time to start deploying my app and I am having a bit of trouble. I've built my choo app and everything was put into the dist directory. I then copied this directory into my static hosting on AWS s3. At first glance, everything seemed to work fine, but when I tried to access any of my dynamic routes, I get "404 page not found". Do I need to do something special in order to package up my routes properly? Running locally works fine with the development server, it's only when I try to package everything up and move it to S3 that my routes are failing and I am getting 404 errors.

This works locally:

var user = require('./views/main')
var app = choo()
app.route('/:user', user)
module.exports = app.mount('body')

Thanks!

YerkoPalma commented 6 years ago

related: https://github.com/choojs/bankai/issues/336

AcidLeroy commented 6 years ago

@YerkoPalma So how do you recommend deploying a choo app using bankai? It's not clear to me what I need to do.

YerkoPalma commented 6 years ago

I don't recommend deploying with bankai if your app has any dynamic routes

AcidLeroy commented 6 years ago

@YerkoPalma Thanks! I'll close this out.