mirror of
https://github.com/swisscom/cf-sample-app-nodejs-mysql.git
synced 2026-12-04 14:38:46 +00:00
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%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| app | ||
| public | ||
| views | ||
| .cfignore | ||
| .gitignore | ||
| CODE_OF_CONDUCT.md | ||
| CONTRIBUTING.md | ||
| LICENSE | ||
| manifest.yml | ||
| package.json | ||
| README.md | ||
| server.js | ||
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