Skip to content

Commit

Permalink
Remove support and references to Heroku
Browse files Browse the repository at this point in the history
Heroku will end their free tier.
  • Loading branch information
xofbd committed Nov 15, 2022
1 parent 1991e70 commit b4d69f2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 20 deletions.
1 change: 0 additions & 1 deletion Procfile

This file was deleted.

15 changes: 3 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/xofbd/unfair-coin-bayes.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/xofbd/unfair-coin-bayes/context:javascript)

# Unfair Coin Bayesian Simulation
This repository creates a web app that simulates the evolving probability distribution of an unfair coin to come up heads using Bayes's theorem. The prior distribution is a Beta distribution with both shape parameters set to one, resulting in a uniform distribution. This repository is ready to deploy a web application using [Flask](https://flask.palletsprojects.com) and [Bokeh](https://bokeh.org) to Heroku. An example of the app can be seen at https://unfair-coin-bayes.herokuapp.com.
This repository creates a web app that simulates the evolving probability distribution of an unfair coin to come up heads using Bayes's theorem. The prior distribution is a Beta distribution with both shape parameters set to one, resulting in a uniform distribution. This repository is ready to deploy a web application using [Flask](https://flask.palletsprojects.com) and [Bokeh](https://bokeh.org) to services such as [Render](https://render.com/). An example of the app can be seen at [here](https://unfair-coin-bayes.onrender.com).

## Prerequisites
You will need either Python 3.8 or 3.9. All required Python packages can be found in the `requirements.txt` file. You will also need a Heroku account and have installed the Heroku CLI. For more information on the Heroku CLI, go to https://devcenter.heroku.com/articles/heroku-cli#download-and-install.
You will need either Python 3.8 or 3.9. All required Python packages can be found in the `requirements.txt` file.

## Running the app locally using Flask
## Running the app locally
You may want to run the app using Flask locally before deploying it to Heroku, especially if you have made any changes to the code. To run locally:

1. clone the repository.
Expand All @@ -23,14 +23,5 @@ Alternatively, you can deploy using [Docker](https://www.docker.com/). You can r
1. `docker build -t unfair-coin-bayes .`
1. `docker run --init --rm -d --publish 127.0.0.1:8000:8000 --env SECRET_KEY=$(bin/set-secret-key --) unfair-coin-bayes`

## Deploying to Heroku
Make sure your app is ready to be deployed to Heroku by running Flask locally. To deploy to Heroku:

1. clone the repository (if you haven't yet).
1. `heroku login` and enter your credentials.
1. `heroku create` or `heroku create app-name` where app-name is a custom app name.
1. `git push heroku master`.
1. `heroku open` or open the app online through your Heroku profile.

## License
This project is distributed under the MIT license. Please see `LICENSE` for more information.
9 changes: 3 additions & 6 deletions bin/set-secret-key
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash
#
# Set SECRET_KEY environmental variable for Heroku
# Set SECRET_KEY environmental variable locally or to stdout
# The key is a 32 random byte string in hexadecimal

set -eu

usage() {
echo "Usage: $0 {local|heroku|--}"
echo "Usage: $0 {local|--}"
}

[[ "$#" -ne 1 ]] && usage && exit 1
Expand All @@ -17,10 +17,7 @@ case "$1" in
local)
export SECRET_KEY="$key"
;;
heroku)
heroku config:set SECRET_KEY="$key"
;;
--)
--)
echo "$key"
;;
*)
Expand Down
1 change: 0 additions & 1 deletion runtime.txt

This file was deleted.

0 comments on commit b4d69f2

Please sign in to comment.