create database "Token" with owner = 'root' encoding ='UTF8' tablespace='pg_default';
docker build -t bambulifelocal/trkd-connector:local -f /e/microservices/trkd-connector/local.Dockerfile /e/microservices/trkd-connector
docker run -itd --name trkd-connector-instance -v /e/microservices/trkd-connector/services:/usr/src/app/services -v /e/microservices/trkd-connector/server:/usr/src/app/server -v /e/microservices/trkd-connector/controllers:/usr/src/app/controllers -p 3016:3000 -e CLIENT_DBHOST=host.docker.internal -e CLIENT_DBTOKEN=Token -e CLIENT_DBPORT=5432 -e CLIENT_PASSWORD=Bambu2018 -e CLIENT_USER=root -e CLIENT_DBTYPE=postgresql bambulifelocal/trkd-connector:local
npm install -g typescript #should be 3.03 and above
# install in local repo will be better though
install ts-compile-on-save plugin in visial studio code, now it should auto compile to js
since most of the dev team is using .js, we will commit both .ts and .js file
Base service configuration for all microservices
We will be using the latest LTS version of Node.js, which at the time of writing, is v8.9.4.
Node.js - download at nodejs.org or install via Node Version Manager, and
npm - v5.6.0 included with your Node.js installation.
Install loopback cli
npm/yarn install -g loopback-cli
This installs the lb command-line tool for scaffolding and modifying LoopBack applications
npm/yarn install
Install all project dependencies
npm/yarn start
Starts the development server and makes your application accessible at
localhost:3000.
Edit datasource database name
{
"db": {
"host": "bambu-postgres.co8o5pwx7mvv.ap-southeast-1.rds.amazonaws.com",
"port": 5432,
"url": "postgres://root:Bambu2018@bambu-postgres.co8o5pwx7mvv.ap-southeast-1.rds.amazonaws.com:5432/<db_name>",
"database": "<db_name>",
"password": "Bambu2018",
"name": "db",
"user": "root",
"connector": "postgresql"
}
}
Create a model
lb model
Model should be server only, Don't select common
Follow the succeeding steps on the cli
npm test
Run the unit test written in mocha and chai
npm run lint
Lints your JavaScript using Airbnb style guide
Content type
Image
Digest
Size
57.3 MB
Last updated
almost 8 years ago
docker pull bambudocker/trkd-connector:develop