Skip to content

Commit 44e1299

Browse files
committed
Create clean repo.
0 parents  commit 44e1299

13 files changed

+742
-0
lines changed

.env.dummy

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# This file helps keep sensitive API keys out of your public git repository.
2+
# Details: https://devcenter.heroku.com/articles/config-vars
3+
#
4+
# Towards this end, please do the following:
5+
#
6+
# 1) Get your Coinbase key from coinbase.com/account/integrations
7+
# 2) Edit the variable below
8+
# 3) cp this file into bitstarter/.env and delete these comments
9+
# $ cp .env.dummy .env
10+
# 4) Now you can do
11+
# $ foreman start
12+
# to run the server locally (and read from these env variables), or
13+
# $ git push heroku master; heroku config:push
14+
# to push the .env file remotely.
15+
COINBASE_API_KEY=this-is-a-dummy-api-key
16+
PORT=8080

.gitignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Heroku environmental variables, including API keys.
2+
# https://devcenter.heroku.com/articles/config-vars
3+
.env
4+
5+
# npm packages
6+
node_modules
7+
8+
# Mac
9+
.DS_Store
10+
11+
# Emacs
12+
*~

.pgpass

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
localhost:5432:bitdb0:ubuntu:bitpass0

Procfile

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web: node web.js

README.md

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
Installation
2+
============
3+
The following instructions will set up a more complex bitstarter than the
4+
one you've done to date. Now you will be recording orders to a database.
5+
The following commands are to be executed on your EC2 remote machine.
6+
7+
```sh
8+
curl https://raw.github.com/startup-class/setup/master/setup.sh | bash
9+
exit # and then log in again
10+
git clone https://github.com/startup-class/bitstarter-ssjs-db.git
11+
cd bitstarter-ssjs-db
12+
./setup-ssjs.sh
13+
```
14+
15+
Local and Remote Testing
16+
========================
17+
Once you have done this you will need to :
18+
19+
1. Edit the `.env` file to include your API key from
20+
http://coinbase.com/account/integrations so that it looks like this:
21+
22+
```bash
23+
[you@ec2~/bitstarter]$head .env
24+
COINBASE_API_KEY=cb27e2ef0a8e872f792612d4d57937e70476ab8041455b00b35d1196cf80f50d
25+
PORT=8080
26+
```
27+
28+
2. Then you can run the server locally and preview at URLs like http://ec2-54-213-131-228.us-west-2.compute.amazonaws.com:8080 as follows:
29+
30+
```sh
31+
foreman start
32+
```
33+
34+
Try placing some orders and then going to the "/orders" URL at the top to
35+
try it out. Note that you will get an "invalid api key" error if you didn't
36+
do the `.env` step above.
37+
38+
39+
3. For remote servers, deploy and push configuration variables
40+
41+
```sh
42+
git push heroku master
43+
heroku config:push
44+
```
45+
46+
Then you can go to a URL like http://safe-dawn-4440.herokuapp.com and submit
47+
orders to test it out. Note again that you will get an "invalid api key"
48+
error if you didn't do the `.env` step above.
49+

0 commit comments

Comments
 (0)