Project Setup
For our example we'll be using JavaScript and express to build a simple example provider for booking products from a local database.
Development Tip
While we're using JavaScript and express in this tutorial, you can implement a provider in any language. You just need to provide the API methods described.
Step 1. Create the project
1. Create the workspaceq
git init my-provider
cd my-provider/
yarn init # Follow the questions prompted
2. Install the dependencies
yarn add express
Step 2. Initialize a basic API
const Express = require('express'),
app = Express(),
port = process.env.PORT || 3000;
app.get('/', (req, res) => {
res.send("Hello World!");
});
app.listen(port, () => {
console.log(`App listening on http://localhost:${port}`);
});
Step 3. Run the app & verify
yarn exec node ./server.js
# => App listening on http://localhost:3000/
curl http://localhost:3000/
# => Hello World!