Osamu Nakamura / GR-PEACH_mbed-os-QRCode-ShoppingCart-node

You are viewing an older revision! See the latest version

Homepage

Getting Started

Installing Node.js and npm

You need to have Node.js and npm installed.

To check if you have them installed, open a terminal or command prompt and run the following commands:

node --version
npm --version

If you see an number output similar to x.x.x for each command, then they are both installed and you can continue to the next section.

To install on Windows or mac, you can download the installer from https://nodejs.org/en/download.

To install on Linux, you can use a package manager. Instructions for installing Node.js on your distribution can be found in the following link:
https://nodejs.org/en/download/package-manager

Pre-requisite

This example assumes that you've already run the following program that can communicate the decoded result of barcode data with mbed Device Connector:

Import programGR-PEACH_mbed-os-client-ZXingSample

Fork of https://developer.mbed.org/teams/Renesas/code/GR-PEACH_mbed-os-client-ZXingSample/

Configuring the Applition

In order to run this app, you need to set up the options shown below via environment variable of .env file stored in the folder GR-PEACH_mbed-os-QRCode-ShoppingCart-node which should be automatically created when cloning this program.

  • ACCESS_KEY
    Set this variable to your Access Key that you can create on mbed Device Connector. if you don't have an Access Key yet, please create it in accordance with the following procedure.
    1. Access https://connector.mbed.com/#accesskeys.
    2. Click Create New Access Key.
    /media/uploads/HinoNaka/screenshot7.png
    When prompted, enter a name for the access key (e.g. "demo") and click ADD.
    /media/uploads/HinoNaka/screenshot8.png

    3. Copy the access key you just created and use it in .env file as follows:

.env

ACCESS_KEY=...
  • PORT
    Set this variable as follows to override the default port for this example if needed. The default port is 8080.

.env

PORT=...

Application Execution

If the configuration is successfully done, you can now run the application by invoking the following: /media/uploads/HinoNaka/shoppingcart_fig1.png
Then, you should see the following message:
/media/uploads/HinoNaka/shoppingcart_fig2.png
Please note that 8080 might be changed. It should depends on your PORT setting mentioned above. After that, please copy and paste the above URL. You should see the following Smart Shopping Cart display:


All wikipages