Skip to content

Latest commit

 

History

History
59 lines (41 loc) · 1.32 KB

README.md

File metadata and controls

59 lines (41 loc) · 1.32 KB

oja actions app example

An example of structuring app business logic using Oja actions.

This demo application demonstrates how application business logic can be structured into independent, shareable actions that can be tested independently and later used to compose more complex actions/pages/responses.

The application uses code generation to automate action and component creation and that includes unit tests generation as well.

Usage

Install

cd examples
yarn

Running tests

yarn test

Running app

node .

New action via code generation

To speed up the process of creating new actions and controllers and required unit tests, the application uses (https://github.com/eBay/oja/blob/master/packages/hygen-oja-generators#readme), a hygen code generation plugin.

Once you install the templates, you can start extending them with your own templates.

Install hygen plugin

npm install hygen -g
npm install hygen-add -g
cd <your app dir>
hygen-add oja-generators

Init oja

hygen oja init

Create new action

hygen action new <action namespace> [--target <target dir>]
# example
# hygen action new consumer/buy