You can deploy and host this ServerSDK application in any node-supported server.
-
Log in to your Heroku account.
-
Click the New button and select Create a new App from Dashboard.
-
Enter an app name and click the Create app button.
-
Navigate to the Deploy tab. Follow the steps to install the Heroku CLI, create a new Git repository, and deploy your application.

After following the previous step, a folder is created containing the Heroku cloned/setup. You now must copy the ServerSDK into the Heroku cloned/setup folder. Copy all of the files located in
vop_server_sdk/secure-server-reference-app. There is no need to copy thedistandnode_modulesfolders. -
Paste the following into the
Procfilefile:web: npm run start-prod-serverThe code runs the ServerSDK in Heroku after a code push.
-
Open the Heroku cloned/setup folder in a terminal, commit and push the files to Heroku using the following commands:
$ git add . $ git commit -am "make it better" $ git push heroku master -
After you push the code, Heroku automatically detects it as a Node.JS app. Your log should look similar to the following after you push:
akodaganur:server-sdk-109-pref aminkodaganur$ heroku login heroku: Press any key to open up the browser to login or q to exit: Opening browser to https://cli-auth.heroku.com/auth/cli/browser/658be33b-6251-4700-ba48-1f5319f3a978?requestor=SFMyNTY.g3QAAAACZAAEZGF0YW0AAAAMNDkuMzcuMTY1Ljg2ZAAGc2lnbmVkbgYA14ka5HQB.G2_9GKq-Q_Lz8L7oFvJplCMG1MMVhr20pcscL6a48jU Logging in... done Logged in as akodaganur@vlocity.com akodaganur:server-sdk-109-pref aminkodaganur$ git add . akodaganur:server-sdk-109-pref aminkodaganur$ git commit -m "Intial commit" [master 2492e4e] Intial commit 1 file changed, 1 insertion(+), 1 deletion(-) akodaganur:server-sdk-109-pref aminkodaganur$ git push heroku master Enumerating objects: 8, done. Counting objects: 100% (8/8), done. Delta compression using up to 8 threads Compressing objects: 100% (6/6), done. Writing objects: 100% (6/6), 593 bytes | 593.00 KiB/s, done. Total 6 (delta 4), reused 0 (delta 0) remote: Compressing source files... done. remote: Building source: remote: remote: -----> Node.js app detected remote: remote: -----> Creating runtime environment remote: remote: NPM_CONFIG_LOGLEVEL=error remote: NODE_ENV=production remote: NODE_MODULES_CACHE=true remote: NODE_VERBOSE=false remote: remote: -----> Installing binaries remote: engines.node (package.json): 12.16.3 remote: engines.npm (package.json): 6.14.4 remote: remote: Resolving node version 12.16.3... remote: Downloading and installing node 12.16.3... remote: npm 6.14.4 already installed with node remote: remote: -----> Restoring cache remote: - node_modules is checked into source control and cannot be cached remote: remote: -----> Installing dependencies remote: Prebuild detected (node_modules already exists) remote: Rebuilding any native modules remote: remote: > protobufjs@6.9.0 postinstall /tmp/build_527a1f8d/node_modules/protobufjs remote: > node scripts/postinstall remote: remote: remote: > core-js@3.6.5 postinstall /tmp/build_527a1f8d/node_modules/core-js remote: > node -e "try{require('./postinstall')}catch(e){}" remote: remote: remote: > fsevents@1.2.13 install /tmp/build_527a1f8d/node_modules/fsevents remote: > node install.js remote: remote: remote: Skipping 'fsevents' build as platform linux is not supported remote: remote: > nodemon@1.19.4 postinstall /tmp/build_527a1f8d/node_modules/nodemon remote: > node bin/postinstall || exit 0 remote: remote: Love nodemon? You can now support the project via the open collective: remote: > https://opencollective.com/nodemon/donate remote: remote: @types/compression@1.7.0 /tmp/build_527a1f8d/node_modules/@types/compression remote: @types/express@4.17.6 /tmp/build_527a1f8d/node_modules/@types/express remote: @types/body-parser@1.19.0 /tmp/build_527a1f8d/node_modules/@types/body-parser remote: @types/connect@3.4.33 /tmp/build_527a1f8d/node_modules/@types/connect remote: @types/node@13.13.5 /tmp/build_527a1f8d/node_modules/@types/node remote: @types/express-serve-static-core@4.17.7 /tmp/build_527a1f8d/node_modules/@types/express-serve-static-core remote: @types/qs@6.9.2 /tmp/build_527a1f8d/node_modules/@types/qs remote: @types/range-parser@1.2.3 /tmp/build_527a1f8d/node_modules/@types/range-parser remote: @types/serve-static@1.13.3 /tmp/build_527a1f8d/node_modules/@types/serve-static remote: @types/mime@2.0.1 /tmp/build_527a1f8d/node_modules/@types/mime remote: @types/cookie-parser@1.4.2 /tmp/build_527a1f8d/node_modules/@types/cookie-parser remote: @types/cors@2.8.6 /tmp/build_527a1f8d/node_modules/@types/cors remote: @types/express-session@1.17.0 /tmp/build_527a1f8d/node_modules/@types/express-session remote: @types/jsonwebtoken@8.3.9 /tmp/build_527a1f8d/node_modules/@types/jsonwebtoken remote: @types/request-promise@4.1.46 /tmp/build_527a1f8d/node_modules/@types/request-promise remote: @types/bluebird@3.5.30 /tmp/build_527a1f8d/node_modules/@types/bluebird remote: @types/request@2.48.4 /tmp/build_527a1f8d/node_modules/@types/request remote: @types/caseless@0.12.2 /tmp/build_527a1f8d/node_modules/@types/caseless remote: @types/tough-cookie@4.0.0 /tmp/build_527a1f8d/node_modules/@types/tough-cookie remote: form-data@2.5.1 /tmp/build_527a1f8d/node_modules/form-data remote: asynckit@0.4.0 /tmp/build_527a1f8d/node_modules/asynckit remote: combined-stream@1.0.8 /tmp/build_527a1f8d/node_modules/combined-stream remote: delayed-stream@1.0.0 /tmp/build_527a1f8d/node_modules/delayed-stream remote: mime-types@2.1.27 /tmp/build_527a1f8d/node_modules/mime-types remote: mime-db@1.44.0 /tmp/build_527a1f8d/node_modules/mime-db remote: @types/spdy@3.4.4 /tmp/build_527a1f8d/node_modules/@types/spdy remote: @vlocity-cme-sdk/digitalcommerce-sdk@107.1.0 /tmp/build_527a1f8d/node_modules/@vlocity-cme-sdk/digitalcommerce-sdk remote: @vlocity-cme-sdk/translation-sdk@107.1.0 /tmp/build_527a1f8d/node_modules/@vlocity-cme-sdk/translation-sdk remote: body-parser@1.19.0 /tmp/build_527a1f8d/node_modules/body-parser remote: bytes@3.1.0 /tmp/build_527a1f8d/node_modules/bytes remote: content-type@1.0.4 /tmp/build_527a1f8d/node_modules/content-type remote: debug@2.6.9 /tmp/build_527a1f8d/node_modules/debug remote: ms@2.0.0 /tmp/build_527a1f8d/node_modules/ms remote: depd@1.1.2 /tmp/build_527a1f8d/node_modules/depd remote: http-errors@1.7.2 /tmp/build_527a1f8d/node_modules/http-errors remote: inherits@2.0.3 /tmp/build_527a1f8d/node_modules/inherits remote: setprototypeof@1.1.1 /tmp/build_527a1f8d/node_modules/setprototypeof remote: statuses@1.5.0 /tmp/build_527a1f8d/node_modules/statuses remote: toidentifier@1.0.0 /tmp/build_527a1f8d/node_modules/toidentifier remote: iconv-lite@0.4.24 /tmp/build_527a1f8d/node_modules/iconv-lite remote: safer-buffer@2.1.2 /tmp/build_527a1f8d/node_modules/safer-buffer remote: on-finished@2.3.0 /tmp/build_527a1f8d/node_modules/on-finished remote: ee-first@1.1.1 /tmp/build_527a1f8d/node_modules/ee-first remote: qs@6.7.0 /tmp/build_527a1f8d/node_modules/qs remote: raw-body@2.4.0 /tmp/build_527a1f8d/node_modules/raw-body remote: unpipe@1.0.0 /tmp/build_527a1f8d/node_modules/unpipe remote: type-is@1.6.18 /tmp/build_527a1f8d/node_modules/type-is remote: is-stream@2.0.0 /tmp/build_527a1f8d/node_modules/gcs-resumable-upload/node_modules/is-stream remote: node-fetch@2.6.0 /tmp/build_527a1f8d/node_modules/gcs-resumable-upload/node_modules/node-fetch remote: mime@2.4.6 /tmp/build_527a1f8d/node_modules/@google-cloud/storage/node_modules/mime remote: readable-stream@3.6.0 /tmp/build_527a1f8d/node_modules/@google-cloud/storage/node_modules/readable-stream remote: xdg-basedir@4.0.0 /tmp/build_527a1f8d/node_modules/@google-cloud/storage/node_modules/xdg-basedir remote: nodemon@1.19.4 /tmp/build_527a1f8d/node_modules/nodemon remote: debug@3.2.6 /tmp/build_527a1f8d/node_modules/nodemon/node_modules/debug remote: ms@2.1.2 /tmp/build_527a1f8d/node_modules/nodemon/node_modules/ms remote: Installing any new modules (package.json) remote: removed 1 package and audited 626 packages in 4.606s remote: remote: 33 packages are looking for funding remote: run `npm fund` for details remote: remote: found 25 vulnerabilities (19 low, 6 high) remote: run `npm audit fix` to fix them, or `npm audit` for details remote: remote: -----> Build remote: Running build remote: remote: > express-typescript@1.0.0 build /tmp/build_527a1f8d remote: > tsc remote: remote: remote: -----> Caching build remote: - node_modules remote: remote: -----> Pruning devDependencies remote: removed 210 packages and audited 412 packages in 4.776s remote: remote: 33 packages are looking for funding remote: run `npm fund` for details remote: remote: found 24 vulnerabilities (19 low, 5 high) remote: run `npm audit fix` to fix them, or `npm audit` for details remote: remote: -----> Build succeeded! remote: -----> Discovering process types remote: Procfile declares types -> web remote: remote: -----> Compressing... remote: Done: 48.3M remote: -----> Launching... remote: Released v28 remote: https://server-sdk-109-pref.herokuapp.com/ deployed to Heroku remote: remote: Verifying deploy... done. To https://git.heroku.com/server-sdk-109-pref.git 455a853..2492e4e master -> master akodaganur:server-sdk-109-pref aminkodaganur$
Note that the base API URL is logged at the end. Once you pushed and deployed successfully, the base URL becomes: https://your-app-name.herokuapp.com/v1/serversdk. You can also find the name in the Heroku Dashboard > Settings > Domains.
To verify whether the Heroku setup is working, open a browser and navigate to https://your-app-name.herokuapp.com/v1/serversdk/getcurrencydetails. The default currency details are displayed.
**note:** `/v1/serversdk` is a default API prefix which can be changed to: `vop_server_sdk/secure-server-reference-app/sdkConfig.ts`/