How to Host website on IBM Cloud?
Wondering about how to host your web application on IBM cloud, why IBM Cloud is better than other cloud solutions and how easy it is to host website on IBM Cloud? If yes, you are in right place, this article will take you through step by step process about how to host web application on IBM cloud using COS(Cloud Object Storage) and IBM Cloud Functions.
Lets understand the workflow of hosting website on IBM Cloud though functional diagram,
As above diagram clearly state that when User will accesses the application hosted on the bucket in Object Storage, it will call the Backend API inside API Gateway after that API Gateway will forward the Request to Cloud Functions and further Cloud Functions actions use IBM Cloudant to store and retrieve guestbook entries.
Without wasting time let jump into the Fun part of this tutorial where we will have fun with IBM services in order to make our Web Application live.
Tutorial Objective
- Deploy a server-less backend and a database
- Expose a REST API
- Host a static website
Step 1: Create the database using IBM Cloudant
To create database we will use IBM Cloudant service which is nothing but a fully managed JSON document database which compatible with Apache CouchDB.
- Navigate to Catalog, under Services, go to the Databases category. Click on the Cloudant tile.
- Under Multitenant select a region.
- Under Configure Cloudant instance pick a *unique name for the service, such as
<yourinitials>-guestbook-db
. - Select a resource group.
- Select IAM and legacy credentials as authentication method.
- Make sure the Lite plan is selected. If you already have a Lite plan, select another service plan.
- Click Create.