PIPPO DI PROVA
TodoMVC using Cloudant and Compose for MongoDB services running on Bluemix.
Refer to the README.md file in the parent directory for general instructions regarding this application.
-
Add items to the todo list by typing into the box and pressing
Enter
-
Mark items as complete by clicking the checkmark to the left of the corresponding item.
-
Delete items by clicking the 'X' to the right of the corresponding item that appears on hover.
-
Edit existing todo items by double-clicking on the corresponding item.
-
Create a Bluemix Account
Sign up for Bluemix, or use an existing account.
-
Download and install the Cloud-foundry CLI tool
-
If you have not already, download node.js 6.7.0 or later and install it on your local machine.
-
Clone the app to your local environment from your terminal using the following command
git clone https://github.com/IBM-Bluemix/todo-apps.git
cd
into thenode
folder of this newly created directory
cd node
- Edit the
manifest.yml
file and change the applicationhost
to something unique.
The host you use will determinate your application url initially, e.g. <host>.mybluemix.net
.
- Create an instance of Cloudant to store the todos
```
cf create-service cloudantNoSQLDB Lite todo-db
```
- Push the application
```
cf push
```
- Create an instance of MongoDB to store the todos
```
cf create-service compose-for-mongodb Standard todo-db
```
- Push the application
```
cf push
```
- Clone the app to your local environment from your terminal using the following command
git clone https://github.com/IBM-Bluemix/todo-apps.git
- Configure a database
- Create an instance of Cloudant to store the todos
```
cf create-service cloudantNoSQLDB Lite todo-db
```
- Create a set of credentials for this service
```
cf create-service-key todo-db for-local
```
- View the credentials and take note of the
url
value
```
cf service-key todo-db for-local
```
- Create a file name
vcap-local.json
in thenode
directory with the following content:
```
{
"services": {
"cloudantNoSQLDB": [
{
"credentials": {
"url":"<URL-FROM-THE-SERVICE-KEY-ABOVE>"
},
"label": "cloudantNoSQLDB",
"plan": "Lite",
"name": "todo-db"
}
]
}
}
```
Replace the url with the value retrieved from the service key.
- Create an instance of Compose for MongoDB to store the todos
```
cf create-service compose-for-mongodb Standard todo-db
```
- Create a set of credentials for this service
```
cf create-service-key todo-db for-local
```
- View the credentials and take note of the
uri
andca_certificate_base64
values
```
cf service-key todo-db for-local
```
- Create a file name
vcap-local.json
in thenode
directory with the following content:
```
{
"services": {
"compose-for-mongodb": [
{
"credentials": {
"ca_certificate_base64": "<CERTIFICATE>",
"uri": "<URI>"
},
"label": "compose-for-mongodb",
"plan": "Standard",
"name": "todo-db"
}
]
}
}
```
Replace the placeholders with the values retrieved from the service key.
- Get the application dependencies
npm install
- Start the application
npm start
To troubleshoot your Bluemix app the main useful source of information is the logs. To see them, run:
cf logs <application-name> --recent
The TodoMVC node sample web application includes code to track deployments to Bluemix and other Cloud Foundry platforms. The following information is sent to a Deployment Tracker service on each deployment:
- Application Name (
application_name
) - Space ID (
space_id
) - Application Version (
application_version
) - Application URIs (
application_uris
)
This data is collected from the VCAP_APPLICATION
environment variable in IBM Bluemix and other Cloud Foundry platforms. This data is used by IBM to track metrics around deployments of sample applications to IBM Bluemix. Only deployments of sample applications that include code to ping the Deployment Tracker service will be tracked.
Deployment tracking can be disabled by removing require("cf-deployment-tracker-client").track();
from the beginning of the server.js
file at the root of this repo.