@vulkano/core 1.3.0 → 1.3.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.
@@ -23,21 +23,29 @@ const AllControllers = require('include-all')({
23
23
  optional: true
24
24
  });
25
25
 
26
+ // Views Config
26
27
  const viewsConfig = require('./views');
27
28
 
28
- const responses = require('./responses');
29
-
30
- const JWT = require('../libs/Jwt');
29
+ // JWT Middleware
30
+ const jwtMiddleware = require('../libs/Jwt');
31
31
 
32
+ // Express Config
32
33
  const expressConfig = require('./express')();
33
34
 
35
+ // Express Responses
36
+ const responses = require('./responses');
37
+
34
38
  module.exports = {
35
39
 
36
40
  routes: {},
37
41
 
38
42
  start: async function loadServerApplication(cb) {
39
43
 
40
- const jwtMiddleware = JWT;
44
+ // Get ENV Vars
45
+ const {
46
+ JWT_SECRET_KEY,
47
+ COOKIES_SECRET_KEY
48
+ } = process.env || {};
41
49
 
42
50
  const vulkano = express();
43
51
 
@@ -73,7 +81,7 @@ module.exports = {
73
81
  // COOKIES - File: app/config/express/cookies.js
74
82
  // ---------------
75
83
  if (expressConfig.cookies && expressConfig.cookies.enabled) {
76
- const cookiesSecretKey = process.env.COOKIES_SECRET_KEY || expressConfig.cookies.key || expressConfig.cookies.secret || '';
84
+ const cookiesSecretKey = COOKIES_SECRET_KEY || expressConfig.cookies.key || expressConfig.cookies.secret || '';
77
85
  if (!cookiesSecretKey) {
78
86
  console.log(' \x1b[33mWARNING\x1b[0m: Set the secret key in the config/express/cookie.js file or COOKIES_SECRET_KEY in the .env file.');
79
87
  }
@@ -171,7 +179,7 @@ module.exports = {
171
179
  // ---------------
172
180
  if (expressConfig.jwt && expressConfig.jwt.enabled) {
173
181
 
174
- const jwtSecretKey = process.env.JWT_SECRET_KEY || expressConfig.jwt.key || expressConfig.jwt.secret || '';
182
+ const jwtSecretKey = JWT_SECRET_KEY || expressConfig.jwt.key || expressConfig.jwt.secret || '';
175
183
  if (!jwtSecretKey) {
176
184
  console.log(' \x1b[41mERROR\x1b[0m: Can not get key in config/express/jwt.js file or JWT_SECRET_KEY in .env file');
177
185
  return;
@@ -299,6 +307,14 @@ module.exports = {
299
307
  }
300
308
  });
301
309
 
310
+ // ---------------
311
+ // PUBLIC PATH - File: app/config/settings.js
312
+ // (if are using Vite)
313
+ // ---------------
314
+ if (!app.viteProxy) {
315
+ vulkano.use(express.static(PUBLIC_PATH));
316
+ }
317
+
302
318
  // ---------------
303
319
  // ROUTES
304
320
  // ---------------
@@ -423,9 +439,12 @@ module.exports = {
423
439
  });
424
440
 
425
441
  // ---------------
426
- // PUBLIC PATH - File: app/config/settings.js
442
+ // PUBLIC PATH
443
+ // (if not are using Vite)
427
444
  // ---------------
428
- vulkano.use(express.static(PUBLIC_PATH));
445
+ if (app.viteProxy) {
446
+ vulkano.use(express.static(PUBLIC_PATH));
447
+ }
429
448
 
430
449
  app.vulkano = vulkano;
431
450
  app.server = server;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vulkano/core",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "A MVC framework using Express 4",
5
5
  "license": "MIT",
6
6
  "author": "Vulkano Team",