-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: automatic import of runtimes with no name (#671)
* fix for automatic import of runtimes with no name Signed-off-by: marcopiraccini <[email protected]> * .env for the test fixtures Signed-off-by: marcopiraccini <[email protected]> --------- Signed-off-by: marcopiraccini <[email protected]>
- Loading branch information
1 parent
3411c5b
commit 0759141
Showing
9 changed files
with
156 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
PLT_SERVER_HOSTNAME=127.0.0.1 | ||
PORT=3042 | ||
PLT_SERVER_LOGGER_LEVEL=info | ||
PLT_SERVICE_1_CONFIG_PARAM=true | ||
PLT_SERVICE_2_CONFIG_PARAM=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"version": "1.0.42", | ||
"dependencies": { | ||
"platformatic": "1.30.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"$schema": "https://platformatic.dev/schemas/v1.22.0/runtime", | ||
"entrypoint": "service-1", | ||
"allowCycles": true, | ||
"hotReload": false, | ||
"autoload": { | ||
"path": "./services" | ||
}, | ||
"server": { | ||
"hostname": "{PLT_SERVER_HOSTNAME}", | ||
"port": "{PORT}", | ||
"logger": { | ||
"level": "{PLT_SERVER_LOGGER_LEVEL}" | ||
} | ||
}, | ||
"managementApi": true | ||
} |
15 changes: 15 additions & 0 deletions
15
test/fixtures/runtime-noname/services/service-1/platformatic.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"$schema": "https://platformatic.dev/schemas/v1.22.0/service", | ||
"service": { | ||
"openapi": true | ||
}, | ||
"plugins": { | ||
"paths": [ | ||
"plugin.js" | ||
] | ||
}, | ||
"watch": true, | ||
"metrics": { | ||
"server": "parent" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
'use strict' | ||
|
||
/** @param {import('fastify').FastifyInstance} app */ | ||
module.exports = async function (app) { | ||
app.log.trace('trace log') | ||
app.log.debug('debug log') | ||
app.log.info('info log') | ||
app.log.warn('warn log') | ||
app.log.error('error log') | ||
app.log.fatal('fatal log') | ||
app.log.fatal('logs finished') | ||
|
||
app.get('/hello', async () => { | ||
return { runtime: 'runtime-1', service: 'service-1' } | ||
}) | ||
|
||
app.post('/mirror', async (req, reply) => { | ||
reply.headers(req.headers) | ||
return req.body | ||
}) | ||
} |
9 changes: 9 additions & 0 deletions
9
test/fixtures/runtime-noname/services/service-2/platformatic.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"$schema": "https://platformatic.dev/schemas/v1.22.0/service", | ||
"service": { | ||
"openapi": true | ||
}, | ||
"plugins": { | ||
"paths": ["plugin.js"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
'use strict' | ||
|
||
/** @param {import('fastify').FastifyInstance} app */ | ||
module.exports = async function (app, options) { | ||
app.log.trace('trace log') | ||
app.log.debug('debug log') | ||
app.log.info('info log') | ||
app.log.warn('warn log') | ||
app.log.error('error log') | ||
app.log.fatal('fatal log') | ||
app.log.fatal('logs finished') | ||
|
||
app.get('/hello', async () => { | ||
return { runtime: 'runtime-1', service: 'service-2' } | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters