how to run a simple file on heroku
Put your ruby script in a bin directory and git push it to Heroku. Now you can execute a shell command in the heroku console.
For example, if your Ruby script is bin/foo.rb, you can run the following command in the Heroku console:
`ruby bin/foo.rb`
Note the use of backticks.
How to run a specific javascript file on Heroku server?
This turned out to be pretty simple:
heroku run node populateData.js
Deploying HTML file on Heroku?
You cant host static website on heroku the github pages will be better suitable
the best workaround is to trick the heroku that we are hosting the php app
convert nameindex.html
to home.html
create index.php
and write <?php include_once(“home.html”); ?>
on it
add composer.json
and push to heroku
How to specify a file to heroku execute first
The log you showed is fine.Procfile
is necessary when no proc is defined. The "default" for a nodejs buildpack is npm start
.
In your package.json
you defined under scripts
what start
does.
In Python projects you don't have something similar to npm start
. So there you would have to create a Procfile
with e.g. the content worker: python myproject.py
edit, package.json
was added
Here is a project that is compatible with Heroku. It's on the heroku branch not master/main: https://github.com/d-zone-org/d-zone/tree/heroku
This is there scripts
section in package.json
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "browserify web/main.js -t brfs -g uglifyify -o web/static/bundle.js",
"watch": "watchify web/main.js -t brfs -d -o web/static/bundle.js -v",
"start": "node index.js"
},
In your picture you don't have a start script defined.
How to run a simple python script on heroku without flask/django?
I disagree and state you want flask
main_app.py
import flask
app = flask.Flask(__name__)
@app.route("/")
def index():
#do whatevr here...
return "Hello Heruko"
then change your procfile to web: gunicorn main_app:app --log-file -
Related Topics
Sending a Delete Request from Sinatra
Rails Change Routing of Submit in Form_For
Get Time Object at Start of Day in a Particular Time Zone
C1 or C2 Coverage Tool for Ruby
How to Allow Binary File Download Using Grape API
Enumerator as an Infinite Generator in Ruby
Memorable Name Generator Gem for Ruby
Datetime with Mongodb/Mongoid and Rails 3 Not Populating
What Are Tainted Objects, and When Should We Untaint Them
Parsing JSON Without Quoted Keys
Rails Way to Detect Mobile Device
How to Timeout Flash Messages in Rails
What Is the Purpose of a 'Transient Do' Block in Factorybot Factories
Is There a Ruby One-Line "Return If X"
Rails 4 Strong Parameters Failing When Creating Instances in Rails Console