@misterzik/espressojs 3.1.15 → 3.1.16

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/.env CHANGED
@@ -1,6 +1,7 @@
1
1
  MONGO_URI=USER:PASSWORD@DOMAIN.mongodb.net
2
2
  MONGO_URI_PORT=27017
3
3
  MONGO_URI_DB=clients
4
- API_URI_ON=FALSE
5
- API_URI=
6
- PORT=8080
4
+ API_URI=""
5
+ API_METHOD="GET"
6
+ API_OBJ_URL=""
7
+ PORT=8080
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  ## Getting Started
8
8
 
9
- - Download [latest release](https://github.com/misterzik/Espresso.js/packages/364567)
9
+ - Download [latest release](https://github.com/misterzik/Espresso.js/releases)
10
10
 
11
11
  `npm install --save @misterzik/espressojs`
12
12
 
@@ -14,8 +14,11 @@
14
14
 
15
15
  ```
16
16
  {
17
- "instance":"global",
18
- "port":8080
17
+ "instance": "production",
18
+ "hostname": "domain.com",
19
+ "port": 8080,
20
+ "mongoDB": false,
21
+ "swapi": false
19
22
  }
20
23
  ```
21
24
 
@@ -26,7 +29,9 @@
26
29
  MONGO_URI_PORT=27017
27
30
  MONGO_URI_DB=clients
28
31
  API_URI_ON=FALSE
29
- API_URI=
32
+ API_URI=""
33
+ API_METHOD="GET"
34
+ API_OBJ_URL=""
30
35
  PORT=8080
31
36
  ```
32
37
 
@@ -62,5 +67,7 @@
62
67
 
63
68
  ### Requirements
64
69
 
70
+ Installed prior using Espresso.JS
71
+
65
72
  - NodeJS
66
73
  - NPM
package/config.json CHANGED
@@ -1 +1,8 @@
1
- { "instance": "global", "port": 8080 }
1
+ {
2
+ "instance": "global",
3
+ "port": 8080,
4
+ "hostname": "",
5
+ "mongoDB": false,
6
+ "API": false,
7
+ "API_OBJ_URL": ""
8
+ }
package/index.js CHANGED
@@ -1,7 +1,10 @@
1
- /**
2
- * EspressoJS - Hippie's Fav Server Plate
3
- * Powered by Vimedev.com Labs
4
- * ----------------
1
+ /*
2
+ * _| _| _| _| _|_|_|
3
+ * _| _| _|_| _|_| _| _|
4
+ * _| _| _| _| _| _| _|
5
+ * _| _| _| _| _| _|
6
+ * _| _| _| _|_|_|
7
+ * EspressoJS - EspressoJS / Espresso
5
8
  * Express Plug & Play Server
6
9
  * -----------------
7
10
  * @param {*} app - EspressoJS by Vimedev.com Labs
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@misterzik/espressojs",
3
- "version": "3.1.15",
3
+ "version": "3.1.16",
4
4
  "description": "EspressoJS / Espresso is your one-stop Express Configuration starting point or boilerplate. Simple, and unopinionated, EspressoJS plug-and-play configurations are based on Express. Espresso will get you started with an Express instance in seconds.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,9 +1,10 @@
1
- /**
2
- * EspressoJS - Hippie's Fav Server Plate
3
- * Powered by Vimedev.com Labs
4
- * ----
5
- * API Routers
6
- * ---
1
+ /*
2
+ * _| _| _| _| _|_|_|
3
+ * _| _| _|_| _|_| _| _|
4
+ * _| _| _| _| _| _| _|
5
+ * _| _| _| _| _| _|
6
+ * _| _| _| _|_|_|
7
+ * EspressoJS - API Routers
7
8
  */
8
9
 
9
10
  const express = require("express");
@@ -1,11 +1,12 @@
1
- /**
2
- * EspressoJS - Hippie's Fav Server Plate
3
- * Powered by Vimedev.com Labs
4
- * ---
5
- * Client Model - WIP
6
- * --
1
+ /*
2
+ * _| _| _| _| _|_|_|
3
+ * _| _| _|_| _|_| _| _|
4
+ * _| _| _| _| _| _| _|
5
+ * _| _| _| _| _| _|
6
+ * _| _| _| _|_|_|
7
+ * EspressoJS - Client Model
8
+ * --
7
9
  * Basic Clients Collection - API CRUD
8
- * ---
9
10
  * @param {*} app - Vimedev.com Labs
10
11
  */
11
12
 
package/routes/index.js CHANGED
@@ -1,8 +1,10 @@
1
- /**
2
- * EspressoJS - Hippie's Fav Server Plate
3
- * Powered by Vimedev.com Labs
4
- * ----
5
- * Routes Control
1
+ /*
2
+ * _| _| _| _| _|_|_|
3
+ * _| _| _|_| _|_| _| _|
4
+ * _| _| _| _| _| _| _|
5
+ * _| _| _| _| _| _|
6
+ * _| _| _| _|_|_|
7
+ * EspressoJS - Routes Control
6
8
  * ----
7
9
  * @param {*} app - Vimedev.com Labs
8
10
  */
@@ -1,35 +1,40 @@
1
1
  /*
2
- * EspressoJS - Hippie's Fav Server Plate
3
- * Powered by Vimedev.com Labs
4
- * ----------------
5
- *
2
+ * _| _| _| _| _|_|_|
3
+ * _| _| _|_| _|_| _| _|
4
+ * _| _| _| _| _| _| _|
5
+ * _| _| _| _| _| _|
6
+ * _| _| _| _|_|_|
7
+ * EspressoJS - EspressoJS / Espresso
8
+ * Dev Template
6
9
  */
10
+ require("dotenv").config();
11
+ const fs = require("fs");
12
+ const configBuffer = fs.readFileSync("./config.json"),
13
+ data = JSON.parse(configBuffer.toString());
7
14
 
8
- var config = (module.exports = {});
9
-
10
- // Settings :: General's
11
-
12
- config.env = "development";
13
- config.hostname = "dev.example.com";
14
- config.port = "8080";
15
-
16
- // Settings :: MongoDB
17
-
18
- config.mongo_isEnabled = true;
19
- config.mongo = {};
20
- config.mongo.uri = process.env.MONGO_URI || "localhost";
21
- config.mongo.port = process.env.MONGO_URI_PORT || "27017";
22
- config.mongo.db = process.env.MONGO_URI_DB || "myFirstDatabase";
23
-
24
- // Settings :: SWAPI Sample
25
-
26
- config.swapi_isEnabled = true;
27
- config.swapi = {};
28
- config.swapi.uri = process.env.API_URI || "https://swapi.dev/api/people/";
29
- config.swapi.configs = {
30
- method: "GET",
31
- url: "",
32
- headers: {
33
- "Content-Type": "application/json",
34
- },
15
+ const config = () => {
16
+ return {
17
+ env: data.instance || "development",
18
+ hostname: data.hostname || "dev.example.com",
19
+ port: data.instance || "8080",
20
+ mongo_isEnabled: data.mongoDB || true,
21
+ mongo: {
22
+ uri: process.env.MONGO_URI || "localhost",
23
+ port: process.env.MONGO_URI_PORT || "27017",
24
+ db: process.env.MONGO_URI_DB || "myFirstDatabase",
25
+ },
26
+ swapi_isEnabled: data.API || true,
27
+ swapi: {
28
+ uri: process.env.API_URI || "https://swapi.dev/api/people/",
29
+ configs: {
30
+ method: process.env.API_METHOD ||"GET",
31
+ url: process.env.API_OBJ_URL || "",
32
+ headers: {
33
+ "Content-Type": "application/json",
34
+ },
35
+ },
36
+ },
37
+ };
35
38
  };
39
+ module.exports = config;
40
+
@@ -1,35 +1,38 @@
1
1
  /*
2
- * EspressoJS - Hippie's Fav Server Plate
3
- * Powered by Vimedev.com Labs
4
- * ----------------
5
- *
2
+ * _| _| _| _| _|_|_|
3
+ * _| _| _|_| _|_| _| _|
4
+ * _| _| _| _| _| _| _|
5
+ * _| _| _| _| _| _|
6
+ * _| _| _| _|_|_|
7
+ * EspressoJS - EspressoJS / Espresso
8
+ * Global Template w/ API
6
9
  */
7
-
8
- var config = (module.exports = {});
9
-
10
- // Settings :: General's
11
-
12
- config.env = "development";
13
- config.hostname = "global.example.com";
14
- config.port = "8080";
15
-
16
- // Settings :: MongoDB
17
-
18
- config.mongo_isEnabled = false;
19
- config.mongo = {};
20
- config.mongo.uri = process.env.MONGO_URI || "localhost";
21
- config.mongo.port = process.env.MONGO_URI_PORT ||"";
22
- config.mongo.db = process.env.MONGO_URI_DB ||"";
23
-
24
- // Settings :: SWAPI Sample
25
-
26
- config.swapi_isEnabled = true;
27
- config.swapi = {};
28
- config.swapi.uri = process.env.API_URI || "https://swapi.dev/api/";
29
- config.swapi.configs = {
30
- method: "GET",
31
- url: "",
32
- headers: {
33
- "Content-Type": "application/json",
34
- },
10
+ require("dotenv").config();
11
+ const fs = require("fs");
12
+ const configBuffer = fs.readFileSync("./config.json"),
13
+ data = JSON.parse(configBuffer.toString());
14
+ const config = () => {
15
+ return {
16
+ env: data.instance || "development",
17
+ hostname: data.hostname || "global.example.com",
18
+ port: data.instance || "8080",
19
+ mongo_isEnabled: data.mongoDB || false,
20
+ mongo: {
21
+ uri: process.env.MONGO_URI || "localhost",
22
+ port: process.env.MONGO_URI_PORT || "",
23
+ db: process.env.MONGO_URI_DB || "",
24
+ },
25
+ swapi_isEnabled: data.API ? data.API : true || true,
26
+ swapi: {
27
+ uri: process.env.API_URI || "https://swapi.dev/api/",
28
+ configs: {
29
+ method: process.env.API_METHOD || "GET",
30
+ url: process.env.API_OBJ_URL || "",
31
+ headers: {
32
+ "Content-Type": "application/json",
33
+ },
34
+ },
35
+ },
36
+ };
35
37
  };
38
+ module.exports = config;
@@ -1,35 +1,38 @@
1
1
  /*
2
- * EspressoJS - Hippie's Fav Server Plate
3
- * Powered by Vimedev.com Labs
4
- * ----------------
5
- *
2
+ * _| _| _| _| _|_|_|
3
+ * _| _| _|_| _|_| _| _|
4
+ * _| _| _| _| _| _| _|
5
+ * _| _| _| _| _| _|
6
+ * _| _| _| _|_|_|
7
+ * EspressoJS - EspressoJS / Espresso
8
+ * Production Template
6
9
  */
7
-
8
- var config = (module.exports = {});
9
-
10
- // Settings :: General's
11
-
12
- config.env = "production";
13
- config.hostname = "www.example.com";
14
- config.port = "80";
15
-
16
- // Settings :: MongoDB
17
-
18
- config.mongo_isEnabled = false;
19
- config.mongo = {};
20
- config.mongo.uri = process.env.MONGO_URI || "localhost";
21
- config.mongo.port = process.env.MONGO_URI_PORT ||"27017";
22
- config.mongo.db = process.env.MONGO_URI_DB ||"clients";
23
-
24
- // Settings :: SWAPI Sample
25
-
26
- config.swapi_isEnabled = false;
27
- config.swapi = {};
28
- config.swapi.uri = process.env.API_URI || "https://swapi.dev/api/people/";
29
- config.swapi.configs = {
30
- method: "GET",
31
- url: "",
32
- headers: {
33
- "Content-Type": "application/json",
34
- },
10
+ require("dotenv").config();
11
+ const fs = require("fs");
12
+ const configBuffer = fs.readFileSync("./config.json"),
13
+ data = JSON.parse(configBuffer.toString());
14
+ const config = () => {
15
+ return {
16
+ env: data.instance || "production",
17
+ hostname: data.hostname || "www.example.com",
18
+ port: data.instance || "80",
19
+ mongo_isEnabled: data.mongoDB || false,
20
+ mongo: {
21
+ uri: process.env.MONGO_URI || "localhost",
22
+ port: process.env.MONGO_URI_PORT || "27017",
23
+ db: process.env.MONGO_URI_DB || "clients",
24
+ },
25
+ swapi_isEnabled: data.API || false,
26
+ swapi: {
27
+ uri: process.env.API_URI || "https://swapi.dev/api/people/",
28
+ configs: {
29
+ method: process.env.API_METHOD || "GET",
30
+ url: process.env.API_OBJ_URL || "",
31
+ headers: {
32
+ "Content-Type": "application/json",
33
+ },
34
+ },
35
+ },
36
+ };
35
37
  };
38
+ module.exports = config;
@@ -1,10 +1,12 @@
1
- /**
2
- * EspressoJS - Hippie's Fav Server Plate
3
- * Powered by Vimedev.com Labs
4
- * ---
5
- * MongoDB Client Controller - WIP
1
+ /*
2
+ * _| _| _| _| _|_|_|
3
+ * _| _| _|_| _|_| _| _|
4
+ * _| _| _| _| _| _| _|
5
+ * _| _| _| _| _| _|
6
+ * _| _| _| _|_|_|
7
+ * EspressoJS - EspressoJS / Espresso is your one-stop
8
+ * Express Configuration starting point
6
9
  */
7
-
8
10
  const Client = require("../../models/client.model.js");
9
11
 
10
12
  /**
package/server/index.js CHANGED
@@ -1,17 +1,15 @@
1
1
  /*
2
- * EspressoJS - Hippie's Fav Server Plate
3
- * Powered by Vimedev.com Labs
4
- * ----------------
5
- * Configuration workflow
2
+ * _| _| _| _| _|_|_|
3
+ * _| _| _|_| _|_| _| _|
4
+ * _| _| _| _| _| _| _|
5
+ * _| _| _| _| _| _|
6
+ * _| _| _| _|_|_|
7
+ * EspressoJS
6
8
  */
7
9
  const fs = require("fs");
8
-
9
10
  require("dotenv").config();
10
11
  const configBuffer = fs.readFileSync("./config.json"),
11
- dataJSON = configBuffer.toString(),
12
- data = JSON.parse(dataJSON);
13
-
12
+ data = JSON.parse(configBuffer.toString());
14
13
  const env = data.instance || process.env.NODE_ENV || "development";
15
14
  const cfg = require("./config/config." + env);
16
-
17
15
  module.exports = cfg;
@@ -1,10 +1,11 @@
1
- /**
2
- * EspressoJS - Hippie's Fav Server Plate
3
- * Powered by Vimedev.com Labs
4
- * ----------------
1
+ /*
2
+ * _| _| _| _| _|_|_|
3
+ * _| _| _|_| _|_| _| _|
4
+ * _| _| _| _| _| _| _|
5
+ * _| _| _| _| _| _|
6
+ * _| _| _| _|_|_|
5
7
  * MongoDB Schema Example
6
8
  */
7
-
8
9
  const mongoose = require("mongoose");
9
10
  const clientSchema = mongoose.Schema(
10
11
  {
@@ -1,10 +1,11 @@
1
1
  /*
2
- * EspressoJS - Hippie's Favy Server Plate
3
- * Powered by Vimedev.com Labs
4
- * ----------------
5
- * Get Artsy! - CLI
2
+ * _| _| _| _| _|_|_|
3
+ * _| _| _|_| _|_| _| _|
4
+ * _| _| _| _| _| _| _|
5
+ * _| _| _| _| _| _|
6
+ * _| _| _| _|_|_|
7
+ * EspressoJS - CLI
6
8
  */
7
-
8
9
  const fs = require("fs");
9
10
  const { exec } = require("child_process");
10
11
  const { string, number } = require("yargs");
@@ -1,10 +1,11 @@
1
1
  /*
2
- * EspressoJS - Hippie's Favy Server Plate
3
- * Powered by Vimedev.com Labs
4
- * ----------------
5
- * Get Artsy! - Global Message for Non-CLI
2
+ * _| _| _| _| _|_|_|
3
+ * _| _| _|_| _|_| _| _|
4
+ * _| _| _| _| _| _| _|
5
+ * _| _| _| _| _| _|
6
+ * _| _| _| _|_|_|
7
+ * EspressoJS - INIT
6
8
  */
7
-
8
9
  module.exports = (app) => {
9
10
  const fs = require("fs");
10
11
  const cfg = require("./../");