Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

routesmith

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

routesmith - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

14

package.json
{
"name": "routesmith",
"version": "1.0.4",
"version": "1.0.5",
"description": "A simple, lightweight routing solution for Express.",
"main": "autorouter.js",
"scripts": {
"test": ""
},
"keywords": [

@@ -18,7 +15,10 @@ "router",

"repository": {
"type":"git",
"url":"https://gitlab.com/Kurnett/routesmith.git"
"type": "git",
"url": "https://github.com/Kurnett/routesmith"
},
"author": "Kurnett",
"license": "MIT"
"license": "MIT",
"bugs": {
"url": "https://github.com/Kurnett/routesmith-sequelize/issues"
}
}

@@ -1,5 +0,5 @@

#RouteSmith
# RouteSmith
RouteSmith is a simple routing solution for Express-based apps. It creates routes based off of a list of objects rather than a file structure, allowing you to quickly generate robust routes with easily-assigned controllers, middleware, and parameters.
##Installation
## Installation
```bash

@@ -9,3 +9,3 @@ $ npm install --save routesmith

##Packages
## Packages
[RouteSmith-Sequelize](https://www.npmjs.com/package/routesmith-sequelize) allows developers to easily create controllers to go along with RouteSmith's routes.

@@ -16,3 +16,3 @@ ```bash

##Usage
## Usage
```bash

@@ -26,19 +26,19 @@ const express = require('express');

```
###Route Data
### Route Data
RouteSmith requires an array of JSON objects containing specific information to be defined in order to generate routes.
####Path
#### Path
The `path` field determines the URL of the endpoints to be generated.
####ID
#### ID
The `id` field determines the name to be used for the URL parameter (e.g. `/users/:userID`).
####Controllers
#### Controllers
Controllers are expected to be objects with `create`, `get`, `getAll`, `update`, and `remove` methods, corresponding to basic CRUD operations.
####Middleware
#### Middleware
Middleware methods can be inserted via the `middleware` array. Middleware is applied to children of each routes - that is, if you have middleware to check for editing permission on one route, that middleware will also check for permissions on all requests to children of that route.
####Children
#### Children
The `children` array contains a list of other routes to be created under the original route.

@@ -48,3 +48,3 @@

###Example Routes
### Example Routes
```bash

@@ -95,2 +95,2 @@ const routes = [

/users/:userID/posts/:postID
```
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc