Deploying Strapi to Heroku - heroku

I've been following the official Strapi tutorials on how to develop and deploy an application to Heroku and it seems you have to configure some files like ./config/environments/**/database.json.
The problem is that, installing the app without --quickstart (yarn create strapi-app my-project), my config folder just has a functions folder and database.js and server.js files.
Should I create manually this database.json or is this supposed to be created automatically when initializing the app without --quickstart?

I was also confused so I manually created the folders /environments/production and inside the file database.json and it worked for me.
Link to the docs: https://strapi.io/documentation/3.0.0-beta.x/deployment/heroku.html#_4-update-your-database-config-file

Related

Moving Google Firebase Project from Old PC to New PC

I had configured my old laptop with firebase-cli to upload my website to Google Cloud Hosting.
Now I got the new laptop and trying to configure the new laptop with firebase-cli. I have installed all required tools for firebase. I transferred the source code from my old laptop to new laptop.
But when I try to deploy code from new laptop by using following command:
firebase deploy --only hosting:myfirstproject
there is an error that myproject is not found in firebase.json
I changed firebase.json from myproject to myfirstproject.
but it is still not working.
I tried using the following command
firebase -P project-id init hosting
This command responds that make sure you have permission to access it.
Can someone guide what is to be done for moving project from old pc to new pc.
Thanks.
I changed firebase.json file as per project name showing in google console. but it is not working and giving the same error that myproject is not in firebase.json
After Lot of testing, I am able to resolve my issue. There was an error that myproject was listed in firebase.json.
So, I made changes to firebase.json outside "public" directory of my project.
I added
"site": "myproject",
to my firebase.json and restarted the laptop.
Then issued command
firebase deploy --only hosting:myproject
and
It worked flawlessly.
Thanks everyone.

Laravel 8 - Envoyer & Homestead Deployment Issues

So I am using Laravel Homestead for my local development. I opted to install it per-project rather than globally so that all of my Homestead configuration files would be tracked in my git repository. To keep my repository clean, I opted to place the entirety of the Laravel application into a sub-directory named 'code'.
This, however, has presented me with a challenge when attempting to deploy my application via Envoyer. It seems as though Envoyer assumes the Laravel application files are in the root directory of the repository. As such, when it attempts to deploy it fails.
I've been searching around and can't seem to find any way of specifying to Envoyer that my Laravel application files are not in the root directory of the repository but are in the 'code' directory. Any help would be greatly appreciated!
Repository Structure:
/
- Homestead related files
- /code
- Laravel application files

How to host a simple index.html with some javascript and css on Heroku?

I'm trying to deploy an application through Heroku which is just an index.html page with some javascript and css.
I've connected my Github repository to it as a deployment method, but it never seems to work.
Every time I type "heroku logs", it spits back out:
"npm ERR! missing script: start" first.
From what I've searched, it tells me that I need to add "start": "somefile.js" as a starting point in package.json, but this is a very simple index.html page with javascript invoked from whenever a couple buttons are pressed.
How am I meant to get past this?
Heroku isn't really built for hosting static websites that have no dynamic server backend. If you want to do that, you should look into using a proper static file host like Amazon S3, Netlify, etc.
However -- if you DO want to do this on Heroku, you can do so by creating a really simple application (here's an article which shows you how to do it using Ruby): https://devcenter.heroku.com/articles/static-sites-ruby
Agree with #rdegges, you need some sort of http server. A basic node http server is pretty trivial to implement as well.
A full tutorial is available, but the keys steps are:
Make sure you have [node, npm, heroku CLI] installed.
In the root of your project directory, run npm init - (this will create a package.json in your root project directory)
Run npm install --save express - (this will add express as a dependency to the package.json file)
Create a file named Procfile in the root directory.
(contents: web: npm app.js)
Create a file named app.js in the root directory. (contents below)
Commit your changes, push to Heroku - git push heroku master
That should do it. Make sure all your files are in a directory called public as specified in the app.js file or change that to reflect where they actually are.
app.js:
var express = require('express');
var app = express();
app.use('/', express.static('public'));
app.listen(process.env.PORT || 8080);
Full Tutorial: https://devcenter.heroku.com/articles/getting-started-with-nodejs#introduction

Deploying phoenix framework on heroku with webpack

I followed the docs in the official website. The problem is I use webpack as my bundler instead of brunch. The deployment is successful. I can even access the api routes. My only problem is the assets (js,css) in the homepage is not found. Locally, I can access the home page successfully when I run mix phoenix.server.
I tried peeking at the priv/static folder in heroku (using heroku run bash) where the files are moved after being compiled and saw the asset files there. Did I miss anything? or a configuration that I should put?
Here is the remote deploy output
http://pastebin.com/1mL1YWTS
Here is my custom compile file (to override phoenix-static buldpack)
http://pastebin.com/BGHf9xBK
Here is my webpack.config.js
http://pastebin.com/Xv2E1yCE
I have used webpack with the following compile:
./node_modules/.bin/webpack -p
mix phoenix.digest
You need to call mix phoenix.digest to generate a manifest that can be used in the static path helpers. http://hexdocs.pm/phoenix/Mix.Tasks.Phoenix.Digest.html#run/1

Brand new AngularFullstack app won't deploy to Heroku

I'm having trouble deploying my app to Heroku. I don't have this issue with an app I started several months ago so I think it must be something wrong with the lastest Angular Fullstack. After several hours of trouble shooting I decided to start from scratch just to see if AngularFullstack would deploy if you create a completely fresh app in an empty directory.
I created the app in the terminal with:
yo angular-fullstack
Without doing anything else I deployed the app to Heroku by typing this in the terminal:
yo angular-fullstack:heroku
Finally I went to the Heroku webaddress and I get the following "Application Error":
An error occurred in the application and your page could not be served. Please try again in a few moments.
If you are the application owner, check your logs for details.
When I look at the Heroku logs I get the exact same error I was getting in my finished project:
Error: ENOENT, no such file or directory '/app/dist/public/favicon.ico'
I've tried putting this file everywhere in my directory structure. There is no 'dist' in directory structure of the new app. I put this directory in the old app with grunt serve:dist but that doesn't fix the problem of locating favicon.ico even though it is there in the public folder. There is no 'app' directory at the top however and it begins looking all the way in my Mac 'User' path. I think this part of the problem that I don't know how to fix.

Resources