You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+42-2Lines changed: 42 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,7 +61,8 @@ More conveniently the Mailer credentials can be provided via environment variabl
61
61
To debug and preview the emails, we use [MailHog](https://github.com/mailhog/MailHog).
62
62
When installing the Clock of Change without Docker, you have to install MailHog manually (see link for details).
63
63
Then set the host address of MailHog in the Clock of Change API and use `1025` as the port number.
64
-
Assuming MailHog is running on localhost, you can then debug the mails under [http://localhost:8025/](http://localhost:8025/).
64
+
65
+
Assuming MailHog is running on localhost or you have chosen the Docker installation, you can debug and preview the mails under [http://localhost:8025/](http://localhost:8025/).
65
66
66
67
## Installation
67
68
@@ -83,7 +84,28 @@ Npm: 4.6.0
83
84
OS: Windows 10
84
85
```
85
86
86
-
**INSTALLATION**
87
+
**DOCKER INSTALLATION**
88
+
89
+
The Clock of Change API server comes bundled as a Docker Container, which enables you to run then server out of the box.
90
+
91
+
Of course you need to have a recent version of [Docker](https://www.docker.com/get-started) installed. If you don't have Docker, follow the instructions of the link.
92
+
You can check the version like this:
93
+
```
94
+
$ docker -v
95
+
Docker version 18.09.1, build 4c52b90
96
+
```
97
+
98
+
To run the Docker version, follow these steps:
99
+
1. First you need to clone the git repository of the Clock of Change API. Head to a directory where you want the git repository to reside
100
+
and open the directory in the console. Then run `git clone https://github.com/Human-Connection/Clock-of-Change-API.git` to clone the repository to this directory.
101
+
2. Go to the newly created Clock-of-Change-API directory (`cd Clock-of-Change-API` in the console)
102
+
3. Run `docker-compose up`. This will build the Docker container on first startup and run it. This can take a while, but after some time you should see the Clock of Change ticking.
103
+
104
+
Now the Clock of Change API server is ready for usage at [http://127.0.0.1:1337](http://127.0.0.1:1337)
105
+
106
+
**LOCAL INSTALLATION & USAGE**
107
+
108
+
If you do not want to use the docker version, you can also install the Clock of Change API server locally.
87
109
88
110
1. First you need to clone the git repository of the Clock of Change API. Head to a directory where you want the git repository to reside
89
111
and open the directory in the console. Then run `git clone https://github.com/Human-Connection/Clock-of-Change-API.git` to clone the repository to this directory.
@@ -99,13 +121,31 @@ Now the Clock of Change API server is ready to tick.
99
121
100
122
**START THE SERVER**
101
123
124
+
This section only applies if you have chosen the local installation.
125
+
When installing the Clock of Change API server with Docker, the server is starting automatically.
126
+
102
127
In the base Clock-of-Change-API directory run
103
128
104
129
`npm run start`
105
130
106
131
in the console to start the Clock of Change API server.
107
132
This will start Nodemon and the Node.js server, which will start listening for and processing requests at [http://localhost:1337](http://localhost:1337).
108
133
134
+
**RUN DATABASE MIGRATIONS**
135
+
136
+
This section only applies if you have chosen the local installation.
137
+
When installing the Clock of Change API server with Docker, the database migrations are applied automatically.
138
+
139
+
To create the necessary tables by applying the database migrations, run `db-migrate up` in the console.
140
+
141
+
This should give you an output like this:
142
+
```
143
+
$ db-migrate up
144
+
[INFO] Processed migration 20190206134449-entries
145
+
[INFO] Processed migration 20190206140226-apikeys
146
+
[INFO] Done
147
+
```
148
+
109
149
**MAKE REQUESTS**
110
150
111
151
Pro Tip: Get [Postman](https://www.getpostman.com/) to make requests. This amazing tool makes working with APIs way easier.
0 commit comments