From 41aaf25e455547d267191aa3cfbda06b2b19f9a9 Mon Sep 17 00:00:00 2001 From: Jonas Zipprick Date: Wed, 8 Jul 2026 13:24:23 +0200 Subject: [PATCH 1/4] feat: Add provider definition and health endpoint --- frontend/index.js | 7 ++++++- provider.yml | 52 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 provider.yml diff --git a/frontend/index.js b/frontend/index.js index 16a3229..91abe8a 100644 --- a/frontend/index.js +++ b/frontend/index.js @@ -12,10 +12,15 @@ app.get('/', (req, res) => { res.sendFile(path.join(__dirname, 'public', 'index.html')); }); +app.get('/health', (req, res) => { + res.setHeader('Content-Type', 'application/json'); + res.end(JSON.stringify({ state: 'healthy' })); +}); + // Catch-all route for shortened URLs - redirect to API app.get('/:shortId', (req, res) => { const { shortId } = req.params; - + // Check if it looks like a short ID (7 characters alphanumeric) if (shortId.length === 7 && /^[a-zA-Z0-9]+$/.test(shortId)) { // Redirect to the API endpoint for this short ID diff --git a/provider.yml b/provider.yml new file mode 100644 index 0000000..aea4000 --- /dev/null +++ b/provider.yml @@ -0,0 +1,52 @@ +name: url-shortener +schemaVersion: v0 +backend: + landscape: + gitUrl: https://github.com/codesphere-cloud/nodejs-template +author: Codesphere Test +capabilities: + pause: false + backups: false + pointInTimeRecovery: false +category: Utilities +description: | + A complete Codesphere app template featuring a URL shortener service with QR code generation, + built with NodeJS and Express using a two-service architecture. +displayName: URL Shortener +iconUrl: foo.com/bar.svg +configSchema: {} +detailsSchema: + type: object + properties: + hostname: + type: string + readOnly: true + service_url_frontend_3000: + type: string + readOnly: true + statusUrl: + type: string + readOnly: true + default: '${{ .hostname }}/health' + status: + type: 'object' + properties: + state: + type: 'string' + 'x-endpoint': + '${{ .statusUrl }}' +secretsSchema: {} +plans: + - id: 0 + name: default + description: default + parameters: {} +versions: + 0.0.1-dev: + ciProfile: dev + gitRef: 158a6cd613db41bca43e6c28000d0f79832e5155 + description: Fix plan IDs (use plan ids that actually exist). Dev Profile + 0.0.1: + ciProfile: prod + gitRef: 158a6cd613db41bca43e6c28000d0f79832e5155 + description: Fix plan IDs (use plan ids that actually exist). Prod Profile From 4c6417e24ea9bf25bcfdbe31ba82f9d387057447 Mon Sep 17 00:00:00 2001 From: Jonas Zipprick Date: Wed, 8 Jul 2026 13:53:22 +0200 Subject: [PATCH 2/4] remove invalid characters --- provider.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/provider.yml b/provider.yml index aea4000..95dee43 100644 --- a/provider.yml +++ b/provider.yml @@ -32,9 +32,8 @@ detailsSchema: type: 'object' properties: state: - type: 'string' - 'x-endpoint': - '${{ .statusUrl }}' + type: string + x-endpoint: '${{ .statusUrl }}' secretsSchema: {} plans: - id: 0 From 282b2ec980c31677a17422064e915fc104bb027d Mon Sep 17 00:00:00 2001 From: Jonas Zipprick Date: Thu, 9 Jul 2026 10:43:08 +0200 Subject: [PATCH 3/4] Update provider.yml --- provider.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provider.yml b/provider.yml index 95dee43..1fde7c6 100644 --- a/provider.yml +++ b/provider.yml @@ -13,7 +13,7 @@ description: | A complete Codesphere app template featuring a URL shortener service with QR code generation, built with NodeJS and Express using a two-service architecture. displayName: URL Shortener -iconUrl: foo.com/bar.svg +iconUrl: https://cloud.codesphere.com/ide/assets/favicon-32x32.png configSchema: {} detailsSchema: type: object From beba2759157b36a5f2e91a080738f5998aac579c Mon Sep 17 00:00:00 2001 From: Jonas Zipprick Date: Thu, 9 Jul 2026 10:43:48 +0200 Subject: [PATCH 4/4] Update provider.yml --- provider.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/provider.yml b/provider.yml index 1fde7c6..0a09704 100644 --- a/provider.yml +++ b/provider.yml @@ -5,6 +5,7 @@ backend: gitUrl: https://github.com/codesphere-cloud/nodejs-template author: Codesphere Test capabilities: + highAvailability: false pause: false backups: false pointInTimeRecovery: false