New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.2 to 1.0.3

245

example-routes.js
module.exports = [
{
path:'settings',
controller:{},
path:'users',
controller:<controller object goes here>,
middleware:[
require('../controllers/settingspermissions')
<middleware objects go here>
],
data:{
id:'settingID',
model:'Settings',
id:'userID',
model:'Users',
required:[
'name'
'name',
'email',
'password'
],
optional:[
'description',
'ownerID',
'public',
'unrestricted'
'phone',
'address'
],
public:[
'id',
'name',
'description',
'ownerID',
'public',
'unrestricted'
'email',
'phone',
'address'
],
req:[
{
name:'ownerID',
name:'organizationID',
hierarchy:[
'user',
'org',
'id'

@@ -40,215 +40,24 @@ ]

{
path:'people',
path:'posts',
controller:<controller object goes here>,
middleware:[
<middleware objects go here>
],
data:{
id:'personID',
belongsTo:'settingID',
model:'People',
id:'postID',
belongsTo:'userID',
model:'Posts',
required:[
'name'
'content'
],
optional:[
'profession',
'appearance',
'personality',
'history'
],
optional:[],
public:[
'id',
'name',
'appearance',
'personality',
'history'
'content',
'userID'
]
}
},
{
path:'locations',
data:{
id:'locationID',
belongsTo:'settingID',
model:'Locations',
required:[
'name'
],
optional:[
'type',
'description',
'history',
'population',
'populationDensity',
'crime',
'wealth'
],
public:[
'id',
'name',
'type',
'description',
'history',
'population',
'populationDensity',
'crime',
'wealth'
]
}
},
{
path:'civilizations',
data:{
id:'civilizationID',
belongsTo:'settingID',
model:'Civilizations',
required:[
'name'
],
optional:[
'description'
],
public:[
'id',
'name',
'description',
'settingID'
]
}
},
{
path:'items',
data:{
id:'itemID',
belongsTo:'settingID',
model:'Items',
required:[
'name'
],
optional:[
'type',
'appearance',
'history'
],
public:[
'id',
'name',
'type',
'appearance',
'history'
]
}
},
{
path:'events',
data:{
id:'eventID',
belongsTo:'settingID',
model:'Events',
required:[
'name'
],
optional:[
'type',
'year',
'description'
],
public:[
'id',
'name',
'type',
'year',
'description'
]
}
},
{
path:'races',
data:{
id:'raceID',
belongsTo:'settingID',
model:'Races',
required:[
'name'
],
optional:[
'description',
'appearance'
],
public:[
'id',
'name',
'description',
'appearance'
]
}
},
{
path:'creatures',
data:{
id:'creatureID',
belongsTo:'settingID',
model:'Creatures',
required:[
'name'
],
optional:[
'description',
'history'
],
public:[
'id',
'name',
'description',
'history'
]
}
},
{
path:'species',
data:{
id:'speciesID',
belongsTo:'settingID',
model:'Species',
required:[
'name'
],
optional:[
'description',
'appearance'
],
public:[
'id',
'name',
'description',
'appearance'
]
}
},
{
path:'spirits',
data:{
id:'spiritID',
belongsTo:'settingID',
model:'Spirits',
required:[
'name'
],
optional:[
'type',
'description',
'history',
'unique'
],
public:[
'id',
'name',
'description',
'history',
'unique'
]
}
}
]
},
{
path:'users',
id:'userID'
}
];

2

package.json
{
"name": "routesmith",
"version": "1.0.2",
"version": "1.0.3",
"description": "A simple, lightweight routing solution for Express.",

@@ -5,0 +5,0 @@ "main": "autorouter.js",

@@ -58,3 +58,5 @@ #RouteSmith

controller:<controller object goes here>,
middleware:[],
middleware:[
<middleware objects go here>
],
data:{

@@ -93,2 +95,6 @@ id:'userID',

path:'posts',
controller:<controller object goes here>,
middleware:[
<middleware objects go here>
],
data:{

@@ -112,2 +118,9 @@ id:'postID',

]
```
Based on this structure, we would have the following routes:
```bash
/users
/users/:userID
/users/:userID/posts
/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