@platformatic/service 0.47.1 → 0.47.3
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/index.js +1 -1
- package/lib/schema.js +0 -1
- package/lib/start.js +19 -16
- package/package.json +6 -6
package/index.js
CHANGED
package/lib/schema.js
CHANGED
package/lib/start.js
CHANGED
|
@@ -41,11 +41,15 @@ async function buildServer (options, app) {
|
|
|
41
41
|
|
|
42
42
|
async function createRestartable (fastify) {
|
|
43
43
|
const config = configManager.current
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
let fastifyOptions = {}
|
|
45
|
+
if (config.server) {
|
|
46
|
+
fastifyOptions = {
|
|
47
|
+
...config.server
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
fastifyOptions.genReqId = function (req) { return randomUUID() }
|
|
48
51
|
|
|
52
|
+
const root = fastify(fastifyOptions)
|
|
49
53
|
root.decorate('platformatic', { configManager, config })
|
|
50
54
|
root.register(app)
|
|
51
55
|
|
|
@@ -62,25 +66,24 @@ async function buildServer (options, app) {
|
|
|
62
66
|
return root
|
|
63
67
|
}
|
|
64
68
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
if (options.server) {
|
|
70
|
+
if (options.server.https) {
|
|
71
|
+
options.server.https.key = await adjustHttpsKeyAndCert(options.server.https.key)
|
|
72
|
+
options.server.https.cert = await adjustHttpsKeyAndCert(options.server.https.cert)
|
|
73
|
+
}
|
|
70
74
|
}
|
|
71
|
-
|
|
72
75
|
const handler = await restartable(createRestartable)
|
|
73
|
-
|
|
76
|
+
if (options.server) {
|
|
77
|
+
handler.decorate('start', async () => {
|
|
78
|
+
url = await handler.listen({ host: options.server.hostname, port: options.server.port })
|
|
79
|
+
return url
|
|
80
|
+
})
|
|
81
|
+
}
|
|
74
82
|
configManager.on('error', function (err) {
|
|
75
83
|
/* c8 ignore next 1 */
|
|
76
84
|
handler.log.error({ err }, 'error reloading the configuration')
|
|
77
85
|
})
|
|
78
86
|
|
|
79
|
-
handler.decorate('start', async () => {
|
|
80
|
-
url = await handler.listen({ host: hostname, port })
|
|
81
|
-
return url
|
|
82
|
-
})
|
|
83
|
-
|
|
84
87
|
return handler
|
|
85
88
|
}
|
|
86
89
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platformatic/service",
|
|
3
|
-
"version": "0.47.
|
|
3
|
+
"version": "0.47.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -67,11 +67,11 @@
|
|
|
67
67
|
"pino-pretty": "^10.0.0",
|
|
68
68
|
"rfdc": "^1.3.0",
|
|
69
69
|
"ua-parser-js": "^1.0.35",
|
|
70
|
-
"@platformatic/client": "0.47.
|
|
71
|
-
"@platformatic/
|
|
72
|
-
"@platformatic/
|
|
73
|
-
"@platformatic/
|
|
74
|
-
"@platformatic/
|
|
70
|
+
"@platformatic/client": "0.47.3",
|
|
71
|
+
"@platformatic/config": "0.47.3",
|
|
72
|
+
"@platformatic/swagger-ui-theme": "0.47.3",
|
|
73
|
+
"@platformatic/telemetry": "0.47.3",
|
|
74
|
+
"@platformatic/utils": "0.47.3"
|
|
75
75
|
},
|
|
76
76
|
"standard": {
|
|
77
77
|
"ignore": [
|