owc-cli

2.0.10 • Public • Published

owc-cli 2.0.10

This is command line interface for owc mvc framework to generate project, modules, controllers, models and so on.

owc is a lightweight mvc framework for building aws lambda web services based on express.

Prerequisites:

  1. You must be familiar with aws-sdk and have knowledge about various aws services.

  2. This lambda web service is deployed with sam command. You need to understand yaml file formats in order to deploy to aws.

Release Notes

2.0.10 - Changed elasticsearch model template to comply with package owc-elasticsearch

2.0.9 - Added ability to create dynamodb models

Installation

Just run below command to install this command line interface globally

          sudo npm i -g owc-cli

Usage

1. Command Overview:

       owc-cli -t <type> -n <name> [options]

options includes:

-d --dest  This is used to specify the destination where you want to create project
-r --root  This is used to provide the root dir of your project when you create modules, models, etc.
-s --schema This is to specify the schema/database your table is in when creating models
-b --database The name of the database connection you define in config.json file
-p --parent This is used to define the parent class of the model you want to create
-l --table The table you want to create model for
-a --all This is to tell the command whether you want to create models for all the tables in a given schema when you create model class for the schema
-f --prefix prefix for the tables, for example all tables start with prefix "tbl_"
-e --elasticsearch the name of the elasticsearch service in config.json file
-m --module the name of the module under which the controller will be created

2. Create a new project

Below command will create a new project "owc-project":

owc-cli -t project -n owc-project -d /home/ubuntu/

3. Create a new module

owc-cli -t module -n user -r /home/ubuntu/owc-project

4. Create a new model class for schema

Please be reminded that the names are case sensitive

owc-cli -r /home/ubuntu/owc-project -t schema -n User -s user -b db -a true -f tbl_ -e elasticsearch

If you have "-a true", models will be created for all the tables in schema "user".

If you have "-e elasticsearch", elasticsearch models will be created for all tables as well.

5. Create a new model class for table

owc-cli -r /home/ubuntu/owc-project -t model -n Tenant -s user -b db -p User -l tbl_tenant -e elasticsearch

6. Create a controller under a given module

owc-cli.js -t controller -m user -n profile -r /home/ubuntu/owc-project

This will create ProfileController under module user

7. Create a controller outside modules

owc-cli.js -t controller -n profile -r /home/ubuntu/owc-project

8. Create a dynamodb model

owc-cli -t dynamodb -n User -r /home/ubuntu/owc-project -l tbl_user

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.10
    9
    • latest

Version History

Package Sidebar

Install

npm i owc-cli

Weekly Downloads

9

Version

2.0.10

License

MIT

Unpacked Size

41.6 kB

Total Files

29

Last publish

Collaborators

  • frankchenjun