Skip to content

Commit c3ce4fb

Browse files
committed
Clean up comments and update README.md
1 parent 6827240 commit c3ce4fb

File tree

4 files changed

+39
-16
lines changed

4 files changed

+39
-16
lines changed

README.md

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
# Colls Framework CLI
22
A CLI tool to build project scaffolding for your new Colls API.
33

4-
## Pre-requisites
5-
6-
- Install & run `MongoDB Server` for your local environment
7-
- (Optional) Install `nodemon` to run your application.
8-
94
## Installation
105
Install `colls-api-cli`
116

127
```sh
138
npm install colls-api-cli -g
149
```
1510

16-
Navigate to your new desired project location. Run the following command to initiate prompts to begin your build.
11+
Navigate to your new desired project location.
12+
13+
Run the following command to initiate prompts to begin your build.
1714

1815
```sh
1916
colls build
@@ -27,7 +24,25 @@ Next, install all project dependencies.
2724
npm install
2825
```
2926

30-
Now your API setup has been completed and you should be able to run the main `app.js` file to serve your api.
27+
Now your new API setup has been completed.
28+
29+
## Running the API
30+
31+
I would personally recommend installing `nodemon` to serve your api on your local environment.
32+
33+
```sh
34+
npm install nodemon -g
35+
```
36+
37+
Nodemon makes it much easier for development. You can change any code within the `app.js` code structure and nodemon will automatically apply changes and restart the server as soon as you save the changes in your files.
38+
39+
To boot up your server, simply run the following command.
40+
41+
```sh
42+
nodemon app
43+
```
44+
45+
## Try it out!
3146

3247
By default, your api will be served on port `3000`. To test your first endpoint, navigate to...
3348
http://localhost:3000/api

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "colls-api-cli",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "Colls API CLI tool generate framework files.",
55
"main": "bin/colls.js",
66
"keywords": [

src/app.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,18 @@ const mongoose = require('mongoose')
66
const config = require('./config/config')
77
const middleware = require('./src/middleware/_common/header')
88

9-
// DB Configuration
10-
mongoose.connect(config.database)
9+
/**
10+
* DB Configuration
11+
*
12+
* By default, the mongoose connection to your configured Mongo DB has been ignored
13+
* so that the code will work outside of the box for those who do not have Mongo
14+
* installed and running.
15+
*
16+
* To use Mongo, uncomment the line below and adjust the configuration file accordingly.
17+
*/
18+
19+
// mongoose.connect(config.database)
20+
1121

1222
// App Configuration
1323
const app = module.exports = express()

src/config/config.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
2-
secret: 'secret',
2+
secret: 'secret', // you should consider changing this
33

44
/**
55
* Origins Header Information
@@ -10,16 +10,14 @@ module.exports = {
1010
*/
1111
prod: {
1212
origins: [
13-
// 'http://your-prod-domain.com',
14-
'*' // NOT SECURE
13+
'*' // NOT SECURE - Change to 'http://your-prod-domain.com',
1514
]
1615
},
1716
dev: {
1817
origins: [
19-
// 'http://your-local-domain.com',
20-
'*' // NOT SECURE
18+
'*' // NOT SECURE - Change to 'http://your-local-domain.com'
2119
]
2220
},
2321
database: 'mongodb://localhost:27017/<mongo-db-name>',
24-
version: 'v1.0'
22+
version: 'v1'
2523
};

0 commit comments

Comments
 (0)