miolo 0.0.5 → 0.0.6
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/lib/server/index.js
CHANGED
|
@@ -41,12 +41,12 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
|
41
41
|
|
|
42
42
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
43
43
|
|
|
44
|
-
function miolo(_x, _x2) {
|
|
44
|
+
function miolo(_x, _x2, _x3) {
|
|
45
45
|
return _miolo.apply(this, arguments);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
function _miolo() {
|
|
49
|
-
_miolo = _asyncToGenerator(function* (sconfig, render) {
|
|
49
|
+
_miolo = _asyncToGenerator(function* (sconfig, render, callback) {
|
|
50
50
|
var _config$http, _config$auth, _config$auth2, _config$routes, _config$routes2;
|
|
51
51
|
|
|
52
52
|
// Init some pieces
|
|
@@ -124,7 +124,12 @@ function _miolo() {
|
|
|
124
124
|
app.listen(config.http.port, function () {
|
|
125
125
|
logger.info('miolo is listening on port ' + config.http.port);
|
|
126
126
|
(0, _cron.init_cron)(logger);
|
|
127
|
+
|
|
128
|
+
if (callback != undefined) {
|
|
129
|
+
callback();
|
|
130
|
+
}
|
|
127
131
|
});
|
|
132
|
+
return app;
|
|
128
133
|
});
|
|
129
134
|
return _miolo.apply(this, arguments);
|
|
130
135
|
}
|
|
@@ -47,10 +47,7 @@ var init_basic_auth_middleware = (app, options) => {
|
|
|
47
47
|
return unauth_err();
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
console.log('authing........');
|
|
51
50
|
var user = yield auth_user(au_user.name, au_user.pass);
|
|
52
|
-
console.log('authed authed');
|
|
53
|
-
console.log(user);
|
|
54
51
|
|
|
55
52
|
if (user === false || user == undefined) {
|
|
56
53
|
return unauth_err();
|
package/package.json
CHANGED
package/src/server/index.js
CHANGED
|
@@ -18,7 +18,7 @@ import { init_route_robots } from './routes/robots'
|
|
|
18
18
|
import { init_route_catch_js_error} from './routes/catch_js_error'
|
|
19
19
|
import { init_route_html_render} from './routes/html_render'
|
|
20
20
|
|
|
21
|
-
async function miolo(sconfig, render) {
|
|
21
|
+
async function miolo(sconfig, render, callback) {
|
|
22
22
|
|
|
23
23
|
// Init some pieces
|
|
24
24
|
const config = init_config(sconfig)
|
|
@@ -92,7 +92,13 @@ async function miolo(sconfig, render) {
|
|
|
92
92
|
app.listen(config.http.port, function () {
|
|
93
93
|
logger.info('miolo is listening on port ' + config.http.port)
|
|
94
94
|
init_cron(logger)
|
|
95
|
+
|
|
96
|
+
if (callback!=undefined) {
|
|
97
|
+
callback()
|
|
98
|
+
}
|
|
95
99
|
})
|
|
100
|
+
|
|
101
|
+
return app
|
|
96
102
|
|
|
97
103
|
}
|
|
98
104
|
|
|
@@ -28,14 +28,8 @@ const init_basic_auth_middleware = ( app, options ) => {
|
|
|
28
28
|
return unauth_err()
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
console.log('authing........')
|
|
32
|
-
|
|
33
31
|
const user = await auth_user(au_user.name, au_user.pass)
|
|
34
32
|
|
|
35
|
-
console.log('authed authed')
|
|
36
|
-
console.log(user)
|
|
37
|
-
|
|
38
|
-
|
|
39
33
|
if (user === false || user == undefined) {
|
|
40
34
|
return unauth_err()
|
|
41
35
|
}
|