Backend for Frontend (BFF) project with ExpressJS on NodeJS
A Backend for Frontend (BFF) is a pattern that allows your frontend to talk to your backend....
- Install the latest NodeJS 6+ LTS version.
- Install Docker on your machine.
- Install the Bluemix CLI
- Download the Bluemix developer tools plugin
- Go to the directory you downloaded the image to, and install the plugin with:
bx plugin install <name-of-the-dev-plugin>
Your application configuration information is stored in config.json
:
{
"vcap": {
"services": {}
}
}
If you selected services added to your project, you will see Cloudant, Object Storage, and other services with their connection information such as username, password, and hostname listed here. This is useful for connecting to remote services while running your application locally.
When you push your application to Bluemix, however, these values are no longer used, and instead Bluemix automatically connects to those bound services through the use of environment variables.
The Bluemix development plugin makes it easy to compile and run your application if you do not have all of the tools installed on your computer yet. Your application will be compiled with Docker containers. To compile and run your app, run:
bx dev run
Your application will be running at http://localhost:8080/
.
Visit http://localhost:8080/
in your browser.