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

express-orm-mvc

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-orm-mvc - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

13

package.json
{
"name": "express-orm-mvc",
"version": "1.0.3",
"version": "1.0.4",
"description": "Express + ORM MVC",

@@ -27,4 +27,4 @@ "main": "index.js",

"dependencies": {
"express": "^3.4.8",
"orm": "^2.1.3",
"express": "^4.0.0",
"orm": "^2.1.5",
"callsite": "^1.0.0"

@@ -37,6 +37,9 @@ },

"request": "^2.34.0",
"coveralls": "^2.8.0",
"orm-2.1.3": "^2.1.3",
"coveralls": "^2.8.0",
"istanbul": "^0.2.6"
"istanbul": "^0.2.6",
"errorhandler": "^1.0.0",
"morgan": "^1.0.0",
"body-parser": "^1.0.2"
}
}

@@ -37,4 +37,4 @@ express-orm-mvc

* [Express](https://github.com/visionmedia/express) v3.4.8
* [ORM](https://github.com/dresende/node-orm2) v2.1.3
* [Express](https://github.com/visionmedia/express) ^4.0.0
* [ORM](https://github.com/dresende/node-orm2) ^2.1.5

@@ -46,9 +46,12 @@ You can specify those dependencies version by option, please refer to [this](#options)

npm install express-orm-mvc --save
Database package
npm install <your database package>
//example
npm install mysql
Refer to ORM document [Connecting to Database](https://github.com/dresende/node-orm2/wiki/Connecting-to-Database)
##App structure

@@ -66,3 +69,3 @@

app.js -- root
Please check [example](example) folder

@@ -93,3 +96,3 @@

//define your orm model here
};
};
```

@@ -100,3 +103,3 @@

models/post.js
```js

@@ -113,2 +116,12 @@ module.exports = function (orm, db) {

####Note:
``express-orm-mvc`` loads models by alphabet order.
For example ``comment`` model has one ``post`` (many-to-one relationship) as ``post_id`` field, so ``post`` model must be loaded before ``comment`` model.
Solution: name the file models name as ``0_post.js`` and ``comment.js``.
You can check [example](example)
###Controllers

@@ -127,3 +140,3 @@

controllers/post.js
```js

@@ -154,3 +167,3 @@ module.exports = {

config/settings.js
A settings file should be like this

@@ -211,5 +224,5 @@

###Express config
config/express.js
A express config file should be like this

@@ -227,3 +240,3 @@

module.exports = function(app, express) {
app.set('title', 'testing');
app.set('title', 'testing');
app.set('views', '../views');

@@ -249,3 +262,3 @@ app.set('view engine', 'ejs');

config/orm.js
A orm config file should be like this

@@ -274,3 +287,3 @@

config/routes.js
A routes config file should be like this

@@ -300,3 +313,3 @@

path: __dirname, //default: auto detect
express: require('express'), //specify your express version
express: require('express'), //specify your express version
orm: require('orm') //specify your orm version

@@ -346,7 +359,2 @@ }, callback);

});
```
##Todo
* Express 4 testing
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/ddo/express-orm-mvc/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
```
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