routesmith-sequelize
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "routesmith-sequelize", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A controller generator for RouteSmith using Sequelize to interact with databases.", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://gitlab.com/Kurnett/routesmith-sequelize.git" | ||
"url": "git+https://github.com/Kurnett/routesmith-sequelize.git" | ||
}, | ||
@@ -26,5 +23,4 @@ "dependencies": { | ||
"bugs": { | ||
"url": "https://gitlab.com/Kurnett/routesmith-sequelize/issues" | ||
}, | ||
"homepage": "https://gitlab.com/Kurnett/routesmith-sequelize#README" | ||
"url": "https://github.com/Kurnett/routesmith-sequelize/issues" | ||
} | ||
} |
@@ -1,5 +0,5 @@ | ||
#RouteSmith | ||
# RouteSmith | ||
RouteSmith is a simple routing solution for Express-based apps. RouteSmith-Sequelize is package that simplifies the creation of controllers to perform CRUD operations on Sequelize models. | ||
##Installation | ||
## Installation | ||
```bash | ||
@@ -9,3 +9,3 @@ $ npm install --save routesmith-sequelize | ||
##Usage | ||
## Usage | ||
```bash | ||
@@ -29,3 +29,3 @@ const express = require('express'); | ||
##Data | ||
## Data | ||
```bash | ||
@@ -66,21 +66,21 @@ module.exports = { | ||
###id | ||
### id | ||
The `id` field determines what label should be used for parameters in the route's URL. Typically, this must match the id of the route created by RouteSmith, as shown in the usage example. | ||
###belongsTo | ||
### belongsTo | ||
The `belongsTo` field is optional, and can only be used if the controller is for a child route. If it is present, it controls which URL parameter is used for a foreign key on the model. For example, if a controller is created for forum posts and every post has an author column as a foreign key for the user table, `belongsTo` could be set to the column's name (`userID`, for instance) if the request URL is `/users/:userID/posts`. | ||
###Model | ||
### Model | ||
The `model` field allows you to define which Sequelize model will be used. | ||
###Required Fields | ||
### Required Fields | ||
The `required` array dictates what values are required in the body of the request during POST and PUT operations. If any of these values are missing from the body of the request, an error will be returned by the controller. | ||
###Optional Fields | ||
### Optional Fields | ||
The `optional` array dictates what values are optional in the body of the request during POST and PUT operations. If they are present, the table will be modified accordingly. If they are absent, no errors will be returned. | ||
###Public Fields | ||
### Public Fields | ||
The `public` array dictates what values are publicly visible in the response of a GET request. | ||
###Request Data | ||
### Request Data | ||
The `req` array allows developers to define values to look for in the request object, typically added by middleware prior to the route being reached. For example, a global middleware function might retrieve user data and attach it to the request object for future use. The `req` array can then define a new name for the object and the hierarchy through the request object that is needed to retrieve the proper value (for nested values - i.e. `req.user.id`). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
8116
2