@misterzik/espressojs 3.2.0 → 3.2.1
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/package.json +1 -1
- package/routes/index.js +3 -3
- package/routes/api/index.js +0 -25
- package/routes/db/index.js +0 -37
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@misterzik/espressojs",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"description": "EspressoJS Introducing Espresso.JS, your ultimate Express configuration starting point and boilerplate. With its simplicity and lack of opinionation, EspressoJS offers plug-and-play configurations built on top of Express.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
package/routes/index.js
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
|
|
12
12
|
const Path = require("path");
|
|
13
13
|
const configuration = require("../server");
|
|
14
|
-
const api = require("
|
|
15
|
-
const db = require("
|
|
14
|
+
const api = require(path.join(rootDir, "routes", "api.js"));
|
|
15
|
+
const db = require(path.join(rootDir, "routes", "db.js"));
|
|
16
16
|
|
|
17
17
|
module.exports = (app) => {
|
|
18
18
|
app.get("/", function (res) {
|
|
@@ -22,7 +22,7 @@ module.exports = (app) => {
|
|
|
22
22
|
app.use("/api", api);
|
|
23
23
|
}
|
|
24
24
|
if (configuration.mongo_isEnabled === true) {
|
|
25
|
-
db
|
|
25
|
+
app.use("/api", db);
|
|
26
26
|
}
|
|
27
27
|
app.use(function (req, res, next) {
|
|
28
28
|
res.status(404).send("404 - Sorry can't find that!");
|
package/routes/api/index.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* _| _| _| _| _|_|_|
|
|
3
|
-
* _| _| _|_| _|_| _| _|
|
|
4
|
-
* _| _| _| _| _| _| _|
|
|
5
|
-
* _| _| _| _| _| _|
|
|
6
|
-
* _| _| _| _|_|_|
|
|
7
|
-
* EspressoJS - API Routers
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
const express = require("express");
|
|
11
|
-
const router = express.Router();
|
|
12
|
-
const configuration = require("../../server");
|
|
13
|
-
|
|
14
|
-
// const { getAPI, getItem, getItemId } = require("../utils");
|
|
15
|
-
// router.get("/v1/", (req, res) => {
|
|
16
|
-
// getAPI(req, res);
|
|
17
|
-
// });
|
|
18
|
-
// router.get("/v1/:item", (req, res, next) => {
|
|
19
|
-
// getItem(req, res, req.params.item);
|
|
20
|
-
// });
|
|
21
|
-
// router.get("/v1/:item/:itemId", (req, res, next) => {
|
|
22
|
-
// getItemId(req, res, req.params.item, req.params.itemId);
|
|
23
|
-
// });
|
|
24
|
-
|
|
25
|
-
module.exports = { router, configuration };
|
package/routes/db/index.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* _| _| _| _| _|_|_|
|
|
3
|
-
* _| _| _|_| _|_| _| _|
|
|
4
|
-
* _| _| _| _| _| _| _|
|
|
5
|
-
* _| _| _| _| _| _|
|
|
6
|
-
* _| _| _| _|_|_|
|
|
7
|
-
* EspressoJS - Client Model
|
|
8
|
-
* --
|
|
9
|
-
* Basic Clients Collection - API CRUD
|
|
10
|
-
* @param {*} app - Vimedev.com Labs
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
const clientController = require("../../server/controllers");
|
|
14
|
-
const url = "/api/clients/";
|
|
15
|
-
|
|
16
|
-
module.exports = (app) => {
|
|
17
|
-
/* Get All */
|
|
18
|
-
app.get(url, (req, res) => {
|
|
19
|
-
clientController.findAll("client", req, res);
|
|
20
|
-
});
|
|
21
|
-
/* Create */
|
|
22
|
-
app.post(url, (req, res) => {
|
|
23
|
-
clientController.create("client", req, res);
|
|
24
|
-
});
|
|
25
|
-
/* Retrieve a single Note with clientId */
|
|
26
|
-
app.get(url + ":clientId", (req, res) => {
|
|
27
|
-
clientController.findOne("client", req, res);
|
|
28
|
-
});
|
|
29
|
-
/** Update a Note with clientId */
|
|
30
|
-
app.put(url + ":clientId", (req, res) => {
|
|
31
|
-
clientController.update("client", req, res);
|
|
32
|
-
});
|
|
33
|
-
/* Delete a Note with clientId */
|
|
34
|
-
app.delete(url + ":clientId", (req, res) => {
|
|
35
|
-
clientController.delete("client", req, res);
|
|
36
|
-
});
|
|
37
|
-
};
|