Skip to content

ClaudioRetico/to-do-list

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bluemix-todo-apps - node overview

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.

How it Works

  1. Add items to the todo list by typing into the box and pressing Enter

  2. Mark items as complete by clicking the checkmark to the left of the corresponding item.

  3. Delete items by clicking the 'X' to the right of the corresponding item that appears on hover.

  4. Edit existing todo items by double-clicking on the corresponding item.

Running the app on Bluemix

  1. Create a Bluemix Account

    Sign up for Bluemix, or use an existing account.

  2. Download and install the Cloud-foundry CLI tool

  3. If you have not already, download node.js 6.7.0 or later and install it on your local machine.

  4. Clone the app to your local environment from your terminal using the following command

git clone https://github.com/IBM-Bluemix/todo-apps.git
  1. cd into the node folder of this newly created directory
cd node
  1. Edit the manifest.yml file and change the application host to something unique.

The host you use will determinate your application url initially, e.g. <host>.mybluemix.net.

To use Cloudant as database

  1. Create an instance of Cloudant to store the todos
```
cf create-service cloudantNoSQLDB Lite todo-db
```
  1. Push the application
```
cf push
```

OR

To use Compose for MongoDB as database

  1. Create an instance of MongoDB to store the todos
```
cf create-service compose-for-mongodb Standard todo-db
```
  1. Push the application
```
cf push
```

Running the app locally

  1. Clone the app to your local environment from your terminal using the following command
git clone https://github.com/IBM-Bluemix/todo-apps.git
  1. Configure a database

To use Cloudant as database

  1. Create an instance of Cloudant to store the todos
```
cf create-service cloudantNoSQLDB Lite todo-db
```
  1. Create a set of credentials for this service
```
cf create-service-key todo-db for-local
```
  1. View the credentials and take note of the url value
```
cf service-key todo-db for-local
```
  1. Create a file name vcap-local.json in the node 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.

To use Compose for MongoDB as database

  1. Create an instance of Compose for MongoDB to store the todos
```
cf create-service compose-for-mongodb Standard todo-db
```
  1. Create a set of credentials for this service
```
cf create-service-key todo-db for-local
```
  1. View the credentials and take note of the uri and ca_certificate_base64 values
```
cf service-key todo-db for-local
```
  1. Create a file name vcap-local.json in the node 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.
  1. Get the application dependencies
npm install
  1. Start the application
npm start

Troubleshooting

To troubleshoot your Bluemix app the main useful source of information is the logs. To see them, run:

cf logs <application-name> --recent

License

Apache License, Version 2.0

Privacy Notice

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.

Disabling Deployment Tracking

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 88.3%
  • HTML 8.0%
  • Shell 3.7%