miolo 0.0.4 → 0.0.8

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.
@@ -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
@@ -121,10 +121,15 @@ function _miolo() {
121
121
  app.use(render.middleware);
122
122
  }
123
123
 
124
- app.listen(config.http.port, function () {
125
- logger.info('miolo is listening on port ' + config.http.port);
124
+ app.listen(config.http.port, config.http.hostname, function () {
125
+ logger.info("miolo is listening on ".concat(config.http.hostname, ":").concat(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
@@ -1,25 +1,25 @@
1
1
  {
2
2
  "name": "miolo",
3
- "version": "0.0.4",
3
+ "version": "0.0.8",
4
4
  "description": "miolo",
5
5
  "main": "lib/index.js",
6
6
  "author": "Afialapis <info@afialapis.com>",
7
7
  "license": "MIT",
8
8
  "dependencies": {
9
- "@babel/core": "^7.16.7",
10
- "@babel/eslint-parser": "^7.16.5",
9
+ "@babel/core": "^7.17.2",
10
+ "@babel/eslint-parser": "^7.17.0",
11
11
  "@babel/preset-env": "7.16.8",
12
12
  "@babel/register": "7.16.9",
13
13
  "@koa/router": "^10.1.1",
14
14
  "assign-deep": "^1.0.1",
15
15
  "babel-plugin-module-resolver": "^4.1.0",
16
16
  "basic-auth": "^2.0.1",
17
+ "calustra": "0.0.17",
18
+ "calustra-router": "0.0.17",
17
19
  "cron": "^1.8.2",
18
- "calustra": "0.0.16",
19
- "calustra-router": "0.0.16",
20
20
  "diskspace": "^2.0.0",
21
- "eslint": "^8.7.0",
22
- "farrapa-colors": "^1.0.2",
21
+ "eslint": "^8.9.0",
22
+ "farrapa-colors": "^1.0.4",
23
23
  "koa": "^2.13.4",
24
24
  "koa-better-body": "^3.3.9",
25
25
  "koa-bodyparser": "^4.3.0",
@@ -33,10 +33,10 @@
33
33
  "koa-socket-2": "2.0.0",
34
34
  "koa-static": "^5.0.0",
35
35
  "nodemailer": "^6.7.2",
36
- "redis": "^4.0.2",
37
36
  "passport-local": "^1.0.0",
37
+ "redis": "^4.0.3",
38
38
  "socket.io": "^4.4.1",
39
- "winston": "^3.4.0"
39
+ "winston": "^3.6.0"
40
40
  },
41
41
  "scripts": {
42
42
  "lint": "eslint src",
@@ -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)
@@ -89,10 +89,16 @@ async function miolo(sconfig, render) {
89
89
  app.use(render.middleware)
90
90
  }
91
91
 
92
- app.listen(config.http.port, function () {
93
- logger.info('miolo is listening on port ' + config.http.port)
92
+ app.listen(config.http.port, config.http.hostname, function () {
93
+ logger.info(`miolo is listening on ${config.http.hostname}:${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
  }