-
Notifications
You must be signed in to change notification settings - Fork 46
BuildOASP4FnApplication
In this chapter we are going to build a serverless backend with OASP4Fn. The main objective of this tutorial is to take an initial contact with OASP4Fn and the necessary tools we gonna use in the development, so at the end of it the user will be enough confident to start developing a new project with OASP4Fn without problems.
In this section we’re going to introduce all the necessary tools we’re gonna need to start programming and a initial configuration if necessary.
Download the installer from the official page and install it. Once installed, the first thing you should do is install the extensions that will help you during the development, to do that follow this steps:
-
Install Settings Sync extension.
-
Open the command palette (Ctrl+Shift+P) and introduce the command: Sync: Download Settings.
-
Provide GIST ID: d976bc200f0403d8045b7e4ee39d4361.
In the case that you are unable to set up the extensions using the method mentioned, you can also use the scripts provided in this repository.
Go to the node.js official page and download the version you like the most, the LTS or the Current as you wish.
Let’s install what is going to be the main language during development: TypeScript. This is a ES6 superset that will help us to get a final clean and distributable JavaScript code. This is installed globally with npm, the package manager used to install and create javascript modules in Node.js, that is installed along with Node, so for install typescript you don’t have to install npm explicitly, only run this command:
npm install –g typescript
As npm, Yarn is a package manager, the differences are that Yarn is quite more faster and usable, so we decided to use it to manage the dependencies of OASP4Fn projects.
To install it you only have to go to the official installation page and follow the instructions.
Even though, if you feel more confortable with npm, you can remain using npm, there is no problem regarding this point.
To start with the tutorial we gonna use the oasp4fn application template, so use the following command to clone it in your local machine:
git clone https://github.com/oasp/oasp4fn-application-template.git jumpTheQueue
This template comes with the structure that has to have an oasp4fn application and the skeleton of some handlers. This handlers are stored on event folders, which we can add or remove adjusting to our needs, so how we only gonna use http events, we gonna access to the cloned folder an remove the s3 folder inside the handlers folder:
This documentation is licensed under the Creative Commons License (Attribution-NoDerivatives 4.0 International).
