Node.js on TIBCO Cloud? Integration
- Getting started
- Prerequisites
- My first Node.js app
- Deploy your first Node.js app
- Test your Node.js app
- Manage your Node.js apps
- Adding dependencies to your app
- Run your app locally
- Understanding the generated code
- Advanced topics
- Best practices
- Resources
Now that we?ve covered the basics, let?s look at a few more advanced topics.
Bottom-up generation
The first part of the tutorial started with the API first, and code second. While this is generally a very useful principle when it comes to building APIs, you can use Node.js for so many other projects as well. To make that a little easier we?ve built an extension for Microsoft Visual Studio Code that helps you with that. You can download the extension from our GitHub page. After you?ve installed it, you now have a command called TCI: Create a new Node.js app
which gives you the minimum boilerplate code you need to get started:
????<folder> ? |???manifest.json ? ????myApp | |???.env | |???package.json | |???server.js ? ????util ? ????logger.js
The manifest.json
file describes what kind of app this is and is used by TIBCO Cloud Integration to carry out building and deploying your app. You should never modify this file, as you might cause the deployment or build step to fail.
The package.json
file contains the meta data of your application (like name, version, etc.) and also contains which modules need to be downloaded to make your app work.
server.js
is the main file of your application. By default the server will listen to port 8000
and that should not be changed.
The .env
file is used by Dotenv, a zero-dependency module that loads environment variables from a .env file into process.env. Storing configuration in the environment separate from code is based on The Twelve-Factor App methodology. By default we?ve put a single entry there for the HTTP port that you can use. As a best practice this is where you should put all your configuration variables
Microsoft Visual Studio Code extension
The extension for Microsoft Visual Studio Code that you can download from our GitHub page provides a whole bunch of useful commands that speed up development. From generating boilerplate code to creating the deployment artifacts (manifest.json and zip) for you.
Recommended Comments
There are no comments to display.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now