@anthonylzq/simba.js 1.5.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [1.6.0](https://github.com/AnthonyLzq/simba.js/compare/v1.5.0...v1.6.0) (2021-12-12)
6
+
7
+
8
+ ### Features
9
+
10
+ * implemented default mongo connection to local database ([1e66e98](https://github.com/AnthonyLzq/simba.js/commit/1e66e982b03eca5c2c3846a10ad827150683da21))
11
+
5
12
  ## [1.5.0](https://github.com/AnthonyLzq/simba.js/compare/v1.3.1...v1.5.0) (2021-12-12)
6
13
 
7
14
 
package/README.md CHANGED
@@ -160,7 +160,13 @@ simba -a myName -e myEmail@email.com -N myProject -D 'This is a test' -H
160
160
 
161
161
  - This project is based in other project from my own, [`typescript-project-generator`](https://www.npmjs.com/package/typescript-project-generator), but only considering the `express-mongoose-node` part.
162
162
  - You are able to run a server that has one main route, `home` (`/`), and another one, `user` (`/user` or `/user/:userId`).
163
- - To connect your server with your `MongoDB` database, you need to provide your `uri` in the `.env`.
163
+ - To connect your server with your `MongoDB` database, you need to provide your `uri` in the `.env`. By default, we will try to connect to a local database. The content of the `.env` file is:
164
+
165
+ ```bash
166
+ MONGO_URI = mongodb://mongo:mongo@mongo:27017/${projectName}
167
+ ```
168
+
169
+ Where `${projectName}` will be replaced by the name of the project you provided in lowercase.
164
170
  - Once you have done that, now you can perform the following `HTTP REQUEST`: `GET`, `POST`, `PATCH` and `DELETE`.
165
171
  - In order to use global variables, just add the one you need in the `src/@types/index.d.ts` file, and add a new `var` with its type to the `global` interface, as follows:
166
172
  ```ts
@@ -466,11 +466,11 @@ class Server {
466
466
  console.log(\`Server running at port \${PORT}\`)
467
467
  })
468
468
 
469
- // try {
470
- // this._mongo()
471
- // } catch (e) {
472
- // console.error(e)
473
- // }
469
+ try {
470
+ this._mongo()
471
+ } catch (e) {
472
+ console.error(e)
473
+ }
474
474
  }
475
475
  }
476
476
 
@@ -1167,7 +1167,7 @@ export { response }
1167
1167
  }
1168
1168
  },
1169
1169
  '.env': {
1170
- content: 'MONGO_URI = ',
1170
+ content: `MONGO_URI = mongodb://mongo:mongo@mongo:27017/${projectName}`,
1171
1171
  file: `${projectName}/.env`
1172
1172
  },
1173
1173
  index: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anthonylzq/simba.js",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "description": "set up a modern backend app by running one command",
5
5
  "main": "lib/index.js",
6
6
  "directories": {