Sample Cloud Foundry Node.js App with mTLS MySQL | Read-only mirror of https://github.com/swisscom/cf-sample-app-nodejs-mysql — Swisscom. Issues & pull requests at the source.
  • HTML 91.6%
  • CSS 3.7%
  • Pug 2.6%
  • JavaScript 2.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2024-10-16 17:16:25 +02:00
app initial commit 2019-01-15 13:16:02 +01:00
public initial commit 2019-01-15 13:16:02 +01:00
views initial commit 2019-01-15 13:16:02 +01:00
.cfignore initial commit 2019-01-15 13:16:02 +01:00
.gitignore initial commit 2019-01-15 13:16:02 +01:00
CODE_OF_CONDUCT.md Compliance bulk update. Add CODE_OF_CONDUCT.md 2024-10-16 17:16:25 +02:00
CONTRIBUTING.md Compliance bulk update. Add CONTRIBUTING.md 2024-10-16 17:16:24 +02:00
LICENSE Create LICENSE 2023-04-24 18:09:43 +02:00
manifest.yml initial commit 2019-01-15 13:16:02 +01:00
package.json initial commit 2019-01-15 13:16:02 +01:00
README.md initial commit 2019-01-15 13:16:02 +01:00
server.js initial commit 2019-01-15 13:16:02 +01:00

Node.js Sample MySQL App

This sample app is based on the Swisscom Node.js Sample App and adds a simple REST API showcasing the new MySQL service with mTLS connection.

Following REST Endpoints are available:
GET /mysql Lists entries
POST /mysql/:entry (no body) Writes the entry in the path to the database.

Prerequisite

MySQL Database mysqldb is created, this can be done as follows:

cf create-service mysql xsmall mysql-cluster
cf create-service mysql-database default mysqldb -c "{\"parent_reference\":\"$(cf service mysql-cluster --guid)\"}"

Deployment

All necessary config is taken care of, simply push the app with cf push.

https://docs.cloudfoundry.org/buildpacks/node/node-tips.html