@platformatic/basic 2.0.0-alpha.4 → 2.0.0-alpha.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/NOTICE +13 -0
- package/README.md +13 -0
- package/config.d.ts +1 -149
- package/index.js +78 -88
- package/lib/base.js +13 -9
- package/lib/schema.js +26 -33
- package/lib/utils.js +1 -5
- package/lib/worker/child-manager.js +21 -6
- package/lib/worker/child-process.js +66 -0
- package/package.json +6 -13
- package/schema.json +2 -512
- package/test/helper.js +43 -13
- package/lib/next.js +0 -105
- package/lib/server.js +0 -134
- package/lib/vite.js +0 -105
- package/lib/worker/next-loader.js +0 -137
- package/test/express.test.js +0 -34
- package/test/fastify.test.js +0 -34
- package/test/fixtures/express/no-build/index.js +0 -16
- package/test/fixtures/express/no-build/package.json +0 -7
- package/test/fixtures/express/no-build/platformatic.app.json +0 -3
- package/test/fixtures/express/no-build/platformatic.as-entrypoint.runtime.json +0 -19
- package/test/fixtures/express/no-build/platformatic.no-entrypoint.runtime.json +0 -16
- package/test/fixtures/express/with-build/index.js +0 -17
- package/test/fixtures/express/with-build/package.json +0 -7
- package/test/fixtures/express/with-build/platformatic.app.json +0 -3
- package/test/fixtures/express/with-build/platformatic.as-entrypoint.runtime.json +0 -19
- package/test/fixtures/express/with-build/platformatic.no-entrypoint.runtime.json +0 -16
- package/test/fixtures/fastify/no-build/index.js +0 -14
- package/test/fixtures/fastify/no-build/package.json +0 -7
- package/test/fixtures/fastify/no-build/platformatic.app.json +0 -3
- package/test/fixtures/fastify/no-build/platformatic.as-entrypoint.runtime.json +0 -19
- package/test/fixtures/fastify/no-build/platformatic.no-entrypoint.runtime.json +0 -16
- package/test/fixtures/fastify/with-build/index.js +0 -15
- package/test/fixtures/fastify/with-build/package.json +0 -7
- package/test/fixtures/fastify/with-build/platformatic.app.json +0 -3
- package/test/fixtures/fastify/with-build/platformatic.as-entrypoint.runtime.json +0 -19
- package/test/fixtures/fastify/with-build/platformatic.no-entrypoint.runtime.json +0 -16
- package/test/fixtures/next/composer-autodetect-prefix/next.config.mjs +0 -5
- package/test/fixtures/next/composer-autodetect-prefix/package.json +0 -15
- package/test/fixtures/next/composer-autodetect-prefix/platformatic.application.json +0 -8
- package/test/fixtures/next/composer-autodetect-prefix/platformatic.runtime.json +0 -21
- package/test/fixtures/next/composer-autodetect-prefix/src/app/layout.js +0 -7
- package/test/fixtures/next/composer-autodetect-prefix/src/app/page.js +0 -5
- package/test/fixtures/next/composer-with-prefix/next.config.js +0 -1
- package/test/fixtures/next/composer-with-prefix/package.json +0 -15
- package/test/fixtures/next/composer-with-prefix/platformatic.application.json +0 -11
- package/test/fixtures/next/composer-with-prefix/platformatic.runtime.json +0 -21
- package/test/fixtures/next/composer-with-prefix/src/app/layout.js +0 -7
- package/test/fixtures/next/composer-with-prefix/src/app/page.js +0 -5
- package/test/fixtures/next/composer-without-prefix/next.config.mjs +0 -3
- package/test/fixtures/next/composer-without-prefix/package.json +0 -15
- package/test/fixtures/next/composer-without-prefix/platformatic.application.json +0 -8
- package/test/fixtures/next/composer-without-prefix/platformatic.runtime.json +0 -21
- package/test/fixtures/next/composer-without-prefix/src/app/layout.js +0 -7
- package/test/fixtures/next/composer-without-prefix/src/app/page.js +0 -5
- package/test/fixtures/next/standalone/next.config.mjs +0 -3
- package/test/fixtures/next/standalone/package.json +0 -15
- package/test/fixtures/next/standalone/platformatic.runtime.json +0 -18
- package/test/fixtures/next/standalone/src/app/layout.js +0 -7
- package/test/fixtures/next/standalone/src/app/page.js +0 -5
- package/test/fixtures/nodejs/no-build/index.js +0 -21
- package/test/fixtures/nodejs/no-build/package.json +0 -7
- package/test/fixtures/nodejs/no-build/platformatic.app.json +0 -3
- package/test/fixtures/nodejs/no-build/platformatic.as-entrypoint.runtime.json +0 -19
- package/test/fixtures/nodejs/no-build/platformatic.no-entrypoint.runtime.json +0 -16
- package/test/fixtures/nodejs/no-configuration/index.js +0 -21
- package/test/fixtures/nodejs/no-configuration/platformatic.as-entrypoint.runtime.json +0 -18
- package/test/fixtures/nodejs/no-configuration/platformatic.no-entrypoint.runtime.json +0 -16
- package/test/fixtures/nodejs/with-build/index.js +0 -20
- package/test/fixtures/nodejs/with-build/package.json +0 -7
- package/test/fixtures/nodejs/with-build/platformatic.app.json +0 -3
- package/test/fixtures/nodejs/with-build/platformatic.as-entrypoint.runtime.json +0 -19
- package/test/fixtures/nodejs/with-build/platformatic.no-entrypoint.runtime.json +0 -16
- package/test/fixtures/platformatic-composer/platformatic.composer.json +0 -20
- package/test/fixtures/platformatic-composer/platformatic.no-prefix.composer.json +0 -23
- package/test/fixtures/platformatic-composer/plugin.js +0 -9
- package/test/fixtures/platformatic-service/platformatic.service.json +0 -15
- package/test/fixtures/platformatic-service/plugin.js +0 -12
- package/test/fixtures/vite/composer-autodetect-prefix/custom.vite.config.js +0 -3
- package/test/fixtures/vite/composer-autodetect-prefix/index.html +0 -13
- package/test/fixtures/vite/composer-autodetect-prefix/main.js +0 -3
- package/test/fixtures/vite/composer-autodetect-prefix/package.json +0 -14
- package/test/fixtures/vite/composer-autodetect-prefix/platformatic.application.json +0 -11
- package/test/fixtures/vite/composer-autodetect-prefix/platformatic.runtime.json +0 -21
- package/test/fixtures/vite/composer-with-prefix/index.html +0 -13
- package/test/fixtures/vite/composer-with-prefix/main.js +0 -3
- package/test/fixtures/vite/composer-with-prefix/package.json +0 -14
- package/test/fixtures/vite/composer-with-prefix/platformatic.application.json +0 -11
- package/test/fixtures/vite/composer-with-prefix/platformatic.runtime.json +0 -21
- package/test/fixtures/vite/composer-without-prefix/index.html +0 -13
- package/test/fixtures/vite/composer-without-prefix/main.js +0 -3
- package/test/fixtures/vite/composer-without-prefix/package.json +0 -14
- package/test/fixtures/vite/composer-without-prefix/platformatic.application.json +0 -8
- package/test/fixtures/vite/composer-without-prefix/platformatic.runtime.json +0 -21
- package/test/fixtures/vite/standalone/custom.vite.config.js +0 -3
- package/test/fixtures/vite/standalone/index.html +0 -13
- package/test/fixtures/vite/standalone/main.js +0 -3
- package/test/fixtures/vite/standalone/package.json +0 -14
- package/test/fixtures/vite/standalone/platformatic.runtime.json +0 -18
- package/test/next.test.js +0 -85
- package/test/node.test.js +0 -66
- package/test/vite.test.js +0 -89
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import fastify from 'fastify'
|
|
2
|
-
|
|
3
|
-
const app = fastify()
|
|
4
|
-
|
|
5
|
-
app.get('/direct', async () => {
|
|
6
|
-
return { ok: true }
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
app.get('/internal', () => {
|
|
10
|
-
return fetch('http://main.plt.local/direct').then(response => response.json())
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
// This would likely fail if our code doesn't work
|
|
14
|
-
app.listen({ port: 1 })
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.52.0.json",
|
|
3
|
-
"entrypoint": "main",
|
|
4
|
-
"watch": false,
|
|
5
|
-
"managementApi": false,
|
|
6
|
-
"metrics": false,
|
|
7
|
-
"server": {
|
|
8
|
-
"logger": {
|
|
9
|
-
"level": "error"
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
"services": [
|
|
13
|
-
{
|
|
14
|
-
"id": "main",
|
|
15
|
-
"path": ".",
|
|
16
|
-
"config": "platformatic.app.json"
|
|
17
|
-
}
|
|
18
|
-
]
|
|
19
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.52.0.json",
|
|
3
|
-
"entrypoint": "main",
|
|
4
|
-
"watch": false,
|
|
5
|
-
"managementApi": false,
|
|
6
|
-
"metrics": false,
|
|
7
|
-
"server": {
|
|
8
|
-
"logger": {
|
|
9
|
-
"level": "error"
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
"services": [
|
|
13
|
-
{ "id": "main", "path": "../../platformatic-service", "config": "platformatic.service.json" },
|
|
14
|
-
{ "id": "internal", "path": ".", "config": "platformatic.app.json" }
|
|
15
|
-
]
|
|
16
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import fastify from 'fastify'
|
|
2
|
-
|
|
3
|
-
export function build () {
|
|
4
|
-
const app = fastify()
|
|
5
|
-
|
|
6
|
-
app.get('/direct', async () => {
|
|
7
|
-
return { ok: true }
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
app.get('/internal', () => {
|
|
11
|
-
return fetch('http://main.plt.local/direct').then(response => response.json())
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
return app
|
|
15
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.52.0.json",
|
|
3
|
-
"entrypoint": "main",
|
|
4
|
-
"watch": false,
|
|
5
|
-
"managementApi": false,
|
|
6
|
-
"metrics": false,
|
|
7
|
-
"server": {
|
|
8
|
-
"logger": {
|
|
9
|
-
"level": "error"
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
"services": [
|
|
13
|
-
{
|
|
14
|
-
"id": "main",
|
|
15
|
-
"path": ".",
|
|
16
|
-
"config": "platformatic.app.json"
|
|
17
|
-
}
|
|
18
|
-
]
|
|
19
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.52.0.json",
|
|
3
|
-
"entrypoint": "main",
|
|
4
|
-
"watch": false,
|
|
5
|
-
"managementApi": false,
|
|
6
|
-
"metrics": false,
|
|
7
|
-
"server": {
|
|
8
|
-
"logger": {
|
|
9
|
-
"level": "error"
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
"services": [
|
|
13
|
-
{ "id": "main", "path": "../../platformatic-service", "config": "platformatic.service.json" },
|
|
14
|
-
{ "id": "internal", "path": ".", "config": "platformatic.app.json" }
|
|
15
|
-
]
|
|
16
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "next",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "0.1.0",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"dev": "next dev",
|
|
7
|
-
"build": "next build",
|
|
8
|
-
"start": "next start"
|
|
9
|
-
},
|
|
10
|
-
"dependencies": {
|
|
11
|
-
"react": "^18.0.0",
|
|
12
|
-
"react-dom": "^18.0.0",
|
|
13
|
-
"next": "^14.2.5"
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.52.0.json",
|
|
3
|
-
"entrypoint": "main",
|
|
4
|
-
"watch": false,
|
|
5
|
-
"managementApi": false,
|
|
6
|
-
"metrics": false,
|
|
7
|
-
"server": {
|
|
8
|
-
"logger": {
|
|
9
|
-
"level": "error"
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
"services": [
|
|
13
|
-
{
|
|
14
|
-
"id": "frontend",
|
|
15
|
-
"path": ".",
|
|
16
|
-
"config": "platformatic.application.json"
|
|
17
|
-
},
|
|
18
|
-
{ "id": "service", "config": "platformatic.service.json", "path": "../../platformatic-service" },
|
|
19
|
-
{ "id": "main", "config": "platformatic.no-prefix.composer.json", "path": "../../platformatic-composer" }
|
|
20
|
-
]
|
|
21
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = {}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "next",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "0.1.0",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"dev": "next dev",
|
|
7
|
-
"build": "next build",
|
|
8
|
-
"start": "next start"
|
|
9
|
-
},
|
|
10
|
-
"dependencies": {
|
|
11
|
-
"react": "^18.0.0",
|
|
12
|
-
"react-dom": "^18.0.0",
|
|
13
|
-
"next": "^14.2.5"
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.52.0.json",
|
|
3
|
-
"entrypoint": "main",
|
|
4
|
-
"watch": false,
|
|
5
|
-
"managementApi": false,
|
|
6
|
-
"metrics": false,
|
|
7
|
-
"server": {
|
|
8
|
-
"logger": {
|
|
9
|
-
"level": "error"
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
"services": [
|
|
13
|
-
{
|
|
14
|
-
"id": "frontend",
|
|
15
|
-
"path": ".",
|
|
16
|
-
"config": "platformatic.application.json"
|
|
17
|
-
},
|
|
18
|
-
{ "id": "service", "config": "platformatic.service.json", "path": "../../platformatic-service" },
|
|
19
|
-
{ "id": "main", "config": "platformatic.composer.json", "path": "../../platformatic-composer" }
|
|
20
|
-
]
|
|
21
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "next",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "0.1.0",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"dev": "next dev",
|
|
7
|
-
"build": "next build",
|
|
8
|
-
"start": "next start"
|
|
9
|
-
},
|
|
10
|
-
"dependencies": {
|
|
11
|
-
"react": "^18.0.0",
|
|
12
|
-
"react-dom": "^18.0.0",
|
|
13
|
-
"next": "^14.2.5"
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.52.0.json",
|
|
3
|
-
"entrypoint": "main",
|
|
4
|
-
"watch": false,
|
|
5
|
-
"managementApi": false,
|
|
6
|
-
"metrics": false,
|
|
7
|
-
"server": {
|
|
8
|
-
"logger": {
|
|
9
|
-
"level": "error"
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
"services": [
|
|
13
|
-
{
|
|
14
|
-
"id": "frontend",
|
|
15
|
-
"path": ".",
|
|
16
|
-
"config": "platformatic.application.json"
|
|
17
|
-
},
|
|
18
|
-
{ "id": "service", "config": "platformatic.service.json", "path": "../../platformatic-service" },
|
|
19
|
-
{ "id": "main", "config": "platformatic.no-prefix.composer.json", "path": "../../platformatic-composer" }
|
|
20
|
-
]
|
|
21
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "next",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "0.1.0",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"dev": "next dev",
|
|
7
|
-
"build": "next build",
|
|
8
|
-
"start": "next start"
|
|
9
|
-
},
|
|
10
|
-
"dependencies": {
|
|
11
|
-
"react": "^18.0.0",
|
|
12
|
-
"react-dom": "^18.0.0",
|
|
13
|
-
"next": "^14.2.5"
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.52.0.json",
|
|
3
|
-
"entrypoint": "main",
|
|
4
|
-
"watch": false,
|
|
5
|
-
"managementApi": false,
|
|
6
|
-
"metrics": false,
|
|
7
|
-
"server": {
|
|
8
|
-
"logger": {
|
|
9
|
-
"level": "error"
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
"services": [
|
|
13
|
-
{
|
|
14
|
-
"id": "main",
|
|
15
|
-
"path": "."
|
|
16
|
-
}
|
|
17
|
-
]
|
|
18
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { createServer } from 'node:http'
|
|
2
|
-
|
|
3
|
-
const server = createServer((req, res) => {
|
|
4
|
-
if (req.url === '/direct') {
|
|
5
|
-
res.writeHead(200, { 'content-type': 'application/json', connection: 'close' })
|
|
6
|
-
res.end(JSON.stringify({ ok: true }))
|
|
7
|
-
} else if (req.url === '/mesh') {
|
|
8
|
-
fetch('http://main.plt.local/direct')
|
|
9
|
-
.then(response => response.json())
|
|
10
|
-
.then(json => {
|
|
11
|
-
res.writeHead(200, { 'content-type': 'application/json', connection: 'close' })
|
|
12
|
-
res.end(JSON.stringify({ ok: true }))
|
|
13
|
-
})
|
|
14
|
-
} else {
|
|
15
|
-
res.writeHead(404, { 'content-type': 'application/json', connection: 'close' })
|
|
16
|
-
res.end(JSON.stringify({ ok: false }))
|
|
17
|
-
}
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
// This would likely fail if our code doesn't work
|
|
21
|
-
server.listen(1)
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.52.0.json",
|
|
3
|
-
"entrypoint": "main",
|
|
4
|
-
"watch": false,
|
|
5
|
-
"managementApi": true,
|
|
6
|
-
"metrics": false,
|
|
7
|
-
"server": {
|
|
8
|
-
"logger": {
|
|
9
|
-
"level": "warn"
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
"services": [
|
|
13
|
-
{
|
|
14
|
-
"id": "main",
|
|
15
|
-
"path": ".",
|
|
16
|
-
"config": "platformatic.app.json"
|
|
17
|
-
}
|
|
18
|
-
]
|
|
19
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.52.0.json",
|
|
3
|
-
"entrypoint": "main",
|
|
4
|
-
"watch": false,
|
|
5
|
-
"managementApi": true,
|
|
6
|
-
"metrics": false,
|
|
7
|
-
"server": {
|
|
8
|
-
"logger": {
|
|
9
|
-
"level": "warn"
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
"services": [
|
|
13
|
-
{ "id": "main", "path": "../../platformatic-service", "config": "platformatic.service.json" },
|
|
14
|
-
{ "id": "internal", "path": ".", "config": "platformatic.app.json" }
|
|
15
|
-
]
|
|
16
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { createServer } from 'node:http'
|
|
2
|
-
|
|
3
|
-
const server = createServer((req, res) => {
|
|
4
|
-
if (req.url === '/direct') {
|
|
5
|
-
res.writeHead(200, { 'content-type': 'application/json', connection: 'close' })
|
|
6
|
-
res.end(JSON.stringify({ ok: true }))
|
|
7
|
-
} else if (req.url === '/mesh') {
|
|
8
|
-
fetch('http://main.plt.local/direct')
|
|
9
|
-
.then(response => response.json())
|
|
10
|
-
.then(json => {
|
|
11
|
-
res.writeHead(200, { 'content-type': 'application/json', connection: 'close' })
|
|
12
|
-
res.end(JSON.stringify({ ok: true }))
|
|
13
|
-
})
|
|
14
|
-
} else {
|
|
15
|
-
res.writeHead(404, { 'content-type': 'application/json', connection: 'close' })
|
|
16
|
-
res.end(JSON.stringify({ ok: false }))
|
|
17
|
-
}
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
// This would likely fail if our code doesn't work
|
|
21
|
-
server.listen(1)
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.52.0.json",
|
|
3
|
-
"entrypoint": "main",
|
|
4
|
-
"watch": false,
|
|
5
|
-
"managementApi": true,
|
|
6
|
-
"metrics": false,
|
|
7
|
-
"server": {
|
|
8
|
-
"logger": {
|
|
9
|
-
"level": "warn"
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
"services": [
|
|
13
|
-
{
|
|
14
|
-
"id": "main",
|
|
15
|
-
"path": "."
|
|
16
|
-
}
|
|
17
|
-
]
|
|
18
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.52.0.json",
|
|
3
|
-
"entrypoint": "main",
|
|
4
|
-
"watch": false,
|
|
5
|
-
"managementApi": true,
|
|
6
|
-
"metrics": false,
|
|
7
|
-
"server": {
|
|
8
|
-
"logger": {
|
|
9
|
-
"level": "warn"
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
"services": [
|
|
13
|
-
{ "id": "main", "path": "../../platformatic-service", "config": "platformatic.service.json" },
|
|
14
|
-
{ "id": "internal", "path": "." }
|
|
15
|
-
]
|
|
16
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { createServer } from 'node:http'
|
|
2
|
-
|
|
3
|
-
export function build () {
|
|
4
|
-
return createServer((req, res) => {
|
|
5
|
-
if (req.url === '/direct') {
|
|
6
|
-
res.writeHead(200, { 'content-type': 'application/json', connection: 'close' })
|
|
7
|
-
res.end(JSON.stringify({ ok: true }))
|
|
8
|
-
} else if (req.url === '/mesh') {
|
|
9
|
-
fetch('http://main.plt.local/direct')
|
|
10
|
-
.then(response => response.json())
|
|
11
|
-
.then(json => {
|
|
12
|
-
res.writeHead(200, { 'content-type': 'application/json', connection: 'close' })
|
|
13
|
-
res.end(JSON.stringify({ ok: true }))
|
|
14
|
-
})
|
|
15
|
-
} else {
|
|
16
|
-
res.writeHead(404, { 'content-type': 'application/json', connection: 'close' })
|
|
17
|
-
res.end(JSON.stringify({ ok: false }))
|
|
18
|
-
}
|
|
19
|
-
})
|
|
20
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.52.0.json",
|
|
3
|
-
"entrypoint": "main",
|
|
4
|
-
"watch": false,
|
|
5
|
-
"managementApi": true,
|
|
6
|
-
"metrics": false,
|
|
7
|
-
"server": {
|
|
8
|
-
"logger": {
|
|
9
|
-
"level": "warn"
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
"services": [
|
|
13
|
-
{
|
|
14
|
-
"id": "main",
|
|
15
|
-
"path": ".",
|
|
16
|
-
"config": "platformatic.app.json"
|
|
17
|
-
}
|
|
18
|
-
]
|
|
19
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.52.0.json",
|
|
3
|
-
"entrypoint": "main",
|
|
4
|
-
"watch": false,
|
|
5
|
-
"managementApi": true,
|
|
6
|
-
"metrics": false,
|
|
7
|
-
"server": {
|
|
8
|
-
"logger": {
|
|
9
|
-
"level": "warn"
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
"services": [
|
|
13
|
-
{ "id": "main", "path": "../../platformatic-service", "config": "platformatic.service.json" },
|
|
14
|
-
{ "id": "internal", "path": ".", "config": "platformatic.app.json" }
|
|
15
|
-
]
|
|
16
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://schemas.platformatic.dev/@platformatic/composer/1.52.0.json",
|
|
3
|
-
"composer": {
|
|
4
|
-
"services": [
|
|
5
|
-
{
|
|
6
|
-
"id": "frontend"
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
"id": "service"
|
|
10
|
-
}
|
|
11
|
-
]
|
|
12
|
-
},
|
|
13
|
-
"plugins": {
|
|
14
|
-
"paths": [
|
|
15
|
-
{
|
|
16
|
-
"path": "./plugin.js"
|
|
17
|
-
}
|
|
18
|
-
]
|
|
19
|
-
}
|
|
20
|
-
}
|