-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.json
More file actions
36 lines (36 loc) · 3.23 KB
/
Copy pathpackage.json
File metadata and controls
36 lines (36 loc) · 3.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{
"name": "express-router",
"description": "A library for organizing routes of an express application",
"version": "0.0.1",
"author": {
"name": "Martín Ciparelli",
"email": "mciparelli@gmail.com"
},
"contributors": [
{
"name": "Martín Ciparelli",
"email": "mciparelli@gmail.com"
}
],
"keywords": [
"express",
"web",
"router",
"app"
],
"repository": {
"type": "git",
"url": "git://github.com/mciparelli/express-router"
},
"main": "index",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"engines": {
"node": "*"
},
"license": "MIT",
"readme": "\n **express-router** is a library for organizing routes of an express application\n## Usage\n\n **express-router** lets you write your express routes in a simpler way.\n You just have to create a 'routes' folder inside your project and place your routes in an index.txt file.\n \n So your app will be structured like this:\n - app.js\n - /routes/\n - index.txt\n - products.js\n - users.js\n\nThen, in your app.js, you just do this after defining app = express():\n\n```js\nrequire('express-router')();\n```\n\n If you want to use another folder for routes:\n\n```js\nrequire('express-router')('thisismynewroutesfolder');\n```\n\n If you do not want to define 'app' globally (**express-router** will check for global.app):\n\n```js\nvar app = express();\nrequire('express-router')(app);\n```\n\n Or both:\n\n```js\nvar app = express();\nrequire('express-router')('thisismynewroutesfolder', app);\n```\n\n Finally you structure your routes in the index.txt file like this: method url middleware1,middleware2,...,middlewareN (empty lines and comments are supported):\n\n ```\n //BEGIN PRODUCT ROUTES\n GET /products products.list\n POST /products products.create\n GET /shoes products.shoes.find,products.shoes.list\n //END PRODUCT ROUTES\n\n //BEGIN USER ROUTES\n GET /users/new users.new\n POST /users/:user users.show\n //END USER ROUTES\n ```\n\n## Installation\n\n $ npm install express-router\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2012 Martín Ciparelli <mciparelli@gmail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"_id": "express-router@0.0.1",
"_from": "express-router"
}