Skip to content
This repository has been archived by the owner on Nov 23, 2021. It is now read-only.

oasp/oasp4fn-application-template

Repository files navigation

NOTE:

OASP has been superseded by devonfw, the Open Source Standard Software Development Platform for state of the art Cloud Native Micro Service and Multi Platform Rich Web Apps, supported by Capgemini.

See http://devonfw.com and on Github http://github.com/devonfw

Individual products within OASP have been renamed to a corresponding one in devonfw.

For example:

  • OAPS4j -> devon4j
  • OASP4js -> devon4ng
  • OASP4NET -> devon4NET

devonfw® is an exclusive and registered (European Trademark) product of Capgemini. Capgemini reserves all intellectual and industrial property rights over devonfw but publishes it under the Apache License, Version 2 – like OASP- which makes devonfw 100% Open Source. See: https://tldrlegal.com/license/apache-license-2.0-(apache-2.0)

Installation

Dependencies

No more dependencies out of the package.json are needed, so the first command required for the installation is:

$ npm install

or

$ yarn

Although, for the environment to work properly, some packages have to be installed globally, so you have to execute these commands next:

$ npm install -g typescript ts-node mocha serverless nodemon

Execution

OASP4Fn

Execute the command:

$ npm run fun

This command will generate the necessary files to deploy and build your handlers. Optionally you can add an option to the last command to additionally generate an app.ts file to execute the handlers through a local express server:

$ npm run fun -- -e

Though that isn't necessary because the serverless framework has a plugin that emulates an api gateway locally.

Build

To build the typescript sources only is necessary to run:

$ npm run build

Start

To start the service locally there are three possibilities:

  1. Use the plugin serverless-offline (Recommended):
$ npm run offline
  1. Use the generated app.ts transpiled (only if you execute npm run fun -- -e in the previous step:
$ npm run start
  1. Use the generated app.ts with ts-node and watching changes in your handlers (only if you execute npm run fun -- -e in the previous step:
$ npm run start:ts

Testing

You can test the correct behaviour of the business logic using the command:

$ npm run test

Also, you can visualize if some of the changes are going wrong when you save it, without executing every time the previous command, to do this you can run the next command on a new shell:

$ npm run test:auto

Releases

No releases published

Packages

No packages published