https://github.com/octalpixel/kaizen-express-framework
Express based framework for Rapid API Development
https://github.com/octalpixel/kaizen-express-framework
Last synced: 9 months ago
JSON representation
Express based framework for Rapid API Development
- Host: GitHub
- URL: https://github.com/octalpixel/kaizen-express-framework
- Owner: octalpixel
- Created: 2018-06-07T12:45:30.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-07-16T10:00:23.000Z (almost 8 years ago)
- Last Synced: 2025-01-15T19:43:16.955Z (over 1 year ago)
- Language: TypeScript
- Size: 68.4 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Kaizen Express Framework Alpha
###### Express based framework for Rapid API Development
# Getting Started
###### Refer sample PostController if lost xD
Install all dependencies
```
npm install
```
Creating Mongoose Schema
* Create your desired mongoose scheme in the Model Folder under app
Creating New Controller Class
* Create class extending the base KDController in the core folder
* Import created Mongoose Schema
* Pass the schema to the super class constructor
Adding New Controller to the Application
* Open app.controller.config.ts
* Import the newly created Controller
* Add to the list of export object
Creating Routes
* Open routes.json
* Follow the structure in the "configs" key to define new route
```
{
//Base URL for the current API
"base_url": "/api/v1/",
//List of Routes for the current base url
"configs": [
{
//Path to the current controller
"path": "post",
//controller name : Case Sensitive
"controller": "PostController",
/*List of methods that is handled
"request method name" : "function in the controller handing the request method"
Default Available Methods in the KDController
get
getOne - needs id as params
create
update - needs id as params
delete - needs id as params
*/
"handlers": {
"GET": "get",
"POST": "create"
}
}
]
}
```
# Running Server
Open terminal and type
```
nodemon
```
and enter to start dev server