How do you access assets in a Pakyow app on heroku? - heroku

Problem: Pakyow App deployed to Heroku and all JS and CSS sourced/linked in template head 404.
I assume this is a problem stemming from Heroku, but rather not one that I am aware of. As far as I know, Heroku allows static assets in the public directory.
Anyway, looking for some helpful pointers from Pakyow users.
The app (currently) is at http://pakyow-go.herokuapp.com and the repo can be found at http://github.com/jphager2/pakyow-go.

This is an unfortunate default config option in the currently released version. To get around it, add this to the production configuration block in app.rb:
app.static = true
The reason it works this way out of the box is in most production cases you don't want the app serving static files. This would instead be the responsibility of the HTTP server. On Heroku though, you want the app server to serve static files unless you host them from a CDN.

Related

Move file from laravel server to Nuxt server

I have two separate project, laravel and nuxt;
i want to, when i upload file from the laravel, it'll be stored on static folder of the nuxt project. Is there any way for that?
For that, you'll need to send your file upload to a CI that will inject it into the Nuxt project, and rebuild the whole Nuxt app.
Also, remember that static is not bundled via Webpack.
Meaning that it will be shipped raw: if it's uploaded while not being properly optimized, it'll be shipped as is (would be better suited into an /assets directory but still >> build time for the whole project required here).
Even hosting it on your Laravel server is more worth at this point.
TLDR: it's not worth to send it to Nuxt's static directory.
I recommend hosting it on a CDN or alike.

Why doesn't my website stop loading (Svelte)

I made a portfolio website, but this site doesn't stop loading.
Sorce code is here.
Does anyone have a solution? or the reason why this happens?
Deploy only your bundled static files. I can access your entire svelte project under your domain. check the sources tab in your browser's DevTools.
since you use vercel for deployment, check this out.
https://github.com/vercel/serve
Check for service workers (If you are using them)
But more probably
2) ALWAYS npm run build before firebase deploy

Deploy ember-cli and rails api

I'm looking for a way to deploy on Heroku a Rails API and an ember-cli application. My directories structure is something like that:
application
frontend
rails-api
Can someone help me? I'm really new Heroku user.
PS: I don't want to use gems like 'ember-cli-rails'
I would deploy them separately, and keep them in separate git repos.
Ember
Use ember-cli-deploy. I would suggest you look into the ember-cli-deploy-lightning-pack. There is a presentation about it here.
This automates the release process -
Builds your Ember app, with asset fingerprints
gzips the assets
Uploads changed files to AWS S3
Puts the full content of your index.html into Redis
Rails
deploy your rails-api app to heroku normally
include a redis addon
set up the route which serves index.html to query it directly from Redis instead
I would suggest aliasing all non-api routes (ie a catchall route) to the root route so you can 'deep link' to your ember app
A big advantage of this process is that you can deploy changes to your frontend very quickly, and without having to take down or restart the server.

Basic HTTP Authentication for a Middleman app

I wonder whether there's an easy way to add Basic HTTP Authentication to a Middleman deployed website? I found some Heroku specific gists, but nothing else.
The Heroku specific gists all seem to need a config.ru file, but do Middleman projects even have such a file? Mine don't.
config.ru is not specific to Middleman or Heroku, but is a convention for serving a rack-based app (see https://devcenter.heroku.com/articles/rack). If you want to have basic auth on a static site that you have built using middleman and then deployed, you will need to set it up in a way that's appropriate to that hosting. Where are you hosting the site?

How do I use Heroku to host a personal website?

I want to use Heroku to host a website that has HTML, CSS and JS files, along with some jpegs and gifs.
I know how to do this with a Rails application, using;
heroku create --stack cedar
It seems that the cedar stack create a repo that is fit for Rails, Java ect apps because the error message is
Heroku push rejected, no Cedar-supported app detected
And when I try to launch the app it just say; Heroku | Welcome to your new app!
Here is a link: http://afternoon-brook-2543.herokuapp.com/
So I want to know how to put some JS, HTML, CSS and images files to host. Perhaps another command may create a simple website stack?
If you saved your root file as index.php then Heroku will detect it as a PHP application - it doesn't need to actually contain PHP code, just been named that.
If you want to send a personal website into Heroku, create an index.php file connected to your website. Launch the app as it was a PHP app. You will be able to launch the app with ease!
Hope this helped!

Resources