pinokiod 2.0.0 → 2.0.2
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/kernel/environment.js +3 -1
- package/package.json +1 -1
- package/script/index.js +3 -1
- package/server/index.js +1 -1
package/kernel/environment.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
const path = require('path')
|
|
2
|
+
const os = require('os')
|
|
2
3
|
const fs = require('fs')
|
|
3
4
|
const Util = require('./util')
|
|
5
|
+
const platform = os.platform()
|
|
4
6
|
const ENVS = [{
|
|
5
7
|
type: ["system"],
|
|
6
8
|
key: "HOMEBREW_CACHE",
|
|
@@ -163,7 +165,7 @@ const ENVS = [{
|
|
|
163
165
|
}, {
|
|
164
166
|
type: ["system"],
|
|
165
167
|
key: "PINOKIO_PORT",
|
|
166
|
-
val: "80",
|
|
168
|
+
val: (platform === "linux" ? "42000" : "80"),
|
|
167
169
|
comment: [
|
|
168
170
|
"##########################################################################",
|
|
169
171
|
"#",
|
package/package.json
CHANGED
package/script/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
const path = require('path')
|
|
2
2
|
const fs = require('fs')
|
|
3
|
+
const os = require('os')
|
|
4
|
+
const platform = os.platform()
|
|
3
5
|
const Server = require('../server')
|
|
4
6
|
class Store {
|
|
5
7
|
set(key, val) {
|
|
@@ -36,7 +38,7 @@ class Store {
|
|
|
36
38
|
}
|
|
37
39
|
const server = new Server({
|
|
38
40
|
//port: 42000,
|
|
39
|
-
port: 80,
|
|
41
|
+
port: (platform === "linux" ? 42000 : 80),
|
|
40
42
|
agent: "web",
|
|
41
43
|
store: new Store()
|
|
42
44
|
})
|
package/server/index.js
CHANGED
|
@@ -2232,7 +2232,7 @@ class Server {
|
|
|
2232
2232
|
})
|
|
2233
2233
|
})
|
|
2234
2234
|
this.app.get("/pre/api/:name", async (req, res) => {
|
|
2235
|
-
let p = path.resolve(this.kernel.homedir, req.params.name, "pinokio.js")
|
|
2235
|
+
let p = path.resolve(this.kernel.homedir, "api", req.params.name, "pinokio.js")
|
|
2236
2236
|
let config = (await this.kernel.loader.load(p)).resolved
|
|
2237
2237
|
if (config && config.pre) {
|
|
2238
2238
|
config.pre.forEach((item) => {
|