Skip to content

Commit 8a6661a

Browse files
committed
[Prerelease] Bumped version number
1 parent 13f01ef commit 8a6661a

File tree

4 files changed

+38
-2
lines changed

4 files changed

+38
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
<a name="0.6.0"></a>
2+
# [0.6.0](https://github.com/EnsembleLab/api-template/compare/0.5.0...0.6.0) (2019-02-10)
3+
4+
5+
16
<a name="0.5.0"></a>
27
# [0.5.0](https://github.com/EnsembleLab/api-template/compare/0.4.1...0.5.0) (2018-05-02)
38

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,37 @@ You will now be able to access CRUD (create, read, update and delete) endpoints
104104

105105
> Note: For every `POST` API calls you need to send an `x-tag` value in the header. This value is used for secure communication between the server and client. It is used for AES encrytion when secure mode is enabled. To get a valid `x-tag` call the `[GET] /initialize` endpoint.
106106
107+
## Some asynchronous goodness
108+
109+
Start the clock (You should only have a single instance of this at all times.)
110+
111+
```
112+
$ npm run clock
113+
```
114+
The clock is similar to a crontab. It dispatches tasks to available workers at a predefined interval.
115+
116+
To define a clock, look for the `clock` collection in the MongoDB you connected to the `LOG_MONGOLAB_URL` environment variable, and create a record similar to the below
117+
118+
```json
119+
{
120+
"crontab" : "* * * * *",
121+
"name" : "Task Name",
122+
"job" : "theJobAsDefinedInTheWorkerFile",
123+
"enabled" : true
124+
}
125+
```
126+
127+
> NOTE: Whenever you change the value of a clock on the DB, you need to restart the clock. (Still looking for the best way to make this automatic)
128+
129+
Start the workers
130+
131+
```
132+
$ npm run workers
133+
```
134+
A worker runs tasks or processes in the background. It is useful for running long running processes and background tasks.
135+
136+
See `/services/queue/jobs` for sample tasks and `/services/queue/workers` for how to setup worker processes.
137+
107138
## Versioning your API endpoints
108139

109140
You can create multiple versions of your API endpoints by simply adding the version number to your route file name. eg. `users.v1.js` will put a version of the users resources on the `/v1/users` endpoint. users.v2.js will put a version of the users resources on the `/v2/users` endpoint. The latest version of the resources will always be available at the `/users` endpoint.

TODO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
|:------|:------:|:------
44
| app.js | 61 | Write a complete Documentation for this project
55
| config/index.js | 12 | Test for production and development senarios
6-
| models/index.js | 14 | Automatically generate tests with the schema structure
76
| routes/index.js | 260 | Test API versioning
87
| routes/index.js | 261 | Test rate limiting
98
| routes/index.js | 262 | Test complete route Loader test
@@ -12,5 +11,6 @@
1211
| routes/index.js | 265 | Make Log requests testable and write unit tests for it
1312
| routes/index.js | 266 | Develop the route loader into a separate node module to be publish on npm
1413
| routes/index.js | 267 | Develop all services onto separate node module to be publish on npm
14+
| models/index.js | 14 | Automatically generate tests with the schema structure
1515
| services/logger/index.js | 48 | Test Error Handler
1616
| services/request/index.js | 90 | Test request module

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "api-template",
3-
"version": "0.5.0",
3+
"version": "0.6.0",
44
"description": "A template for creating APIs Fast",
55
"main": "app.js",
66
"scripts": {

0 commit comments

Comments
 (0)