-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[refactor] uniformización de estilo de código del servidor
- Loading branch information
Showing
9 changed files
with
7,346 additions
and
5,888 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,21 @@ | ||
|
||
var path = require('path') | ||
, util = require('util') | ||
, serveStatic = require('serve-static') | ||
, bodyParser = require('body-Parser') | ||
//, methodOverride = require('method-override') | ||
, express = require("express") | ||
, app = express() | ||
; | ||
|
||
|
||
|
||
|
||
|
||
app.set('port', process.env.PORT || 3000); | ||
app.use(serveStatic(path.join('./public'), { maxAge: 86400000 })); | ||
app.set('views', './src/views'); | ||
app.engine('jade', require("jade").__express); | ||
app.set('view engine', 'jade'); | ||
//app.use(methodOverride()) | ||
app.use(bodyParser.urlencoded({extended: true})); | ||
app.use(bodyParser.json()) | ||
|
||
var path = require('path'), | ||
util = require('util'), | ||
serveStatic = require('serve-static'), | ||
bodyParser = require('body-parser'), | ||
// methodOverride = require('method-override') | ||
express = require('express'), | ||
app = express(); | ||
|
||
app.engine('jade', require('jade').__express); | ||
|
||
app.set('port', process.env.PORT || 3000); | ||
app.set('views', './src/views'); | ||
app.set('view engine', 'jade'); | ||
|
||
app.use(serveStatic(path.join('./public'), { maxAge: 86400000 })); | ||
// app.use(methodOverride()) | ||
app.use(bodyParser.urlencoded({ extended: true })); | ||
app.use(bodyParser.json()); | ||
|
||
module.exports = app; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,25 @@ | ||
var dbURI = 'mongodb://127.0.0.1/cms'; | ||
var mongoose = require("mongoose"); | ||
|
||
var mongoose = require('mongoose'), | ||
dbURI = 'mongodb://127.0.0.1/cms'; | ||
|
||
|
||
mongoose.connect(dbURI); | ||
|
||
mongoose.connection.on('connected', function () { | ||
|
||
console.log('Mongoose default connection open to ' + dbURI); | ||
|
||
}); | ||
|
||
// If the connection throws an error | ||
|
||
mongoose.connection.on('error',function (err) { | ||
|
||
console.log('Mongoose default connection error: ' + err); | ||
|
||
}); | ||
|
||
// When the connection is disconnected | ||
mongoose.connection.on('reconnect', function () { | ||
console.log('Mongoose Reconected'+ date()); | ||
}); | ||
mongoose.connection.on('disconnected', function () { | ||
|
||
console.log('Mongoodb disconnected...trying to reconnect '+ new Date()); | ||
mongoose.connect(dbURI); | ||
}); | ||
|
||
|
||
module.exports = mongoose; | ||
mongoose.connect(dbURI); | ||
|
||
mongoose.connection.on('connected', function() { | ||
console.log('Mongoose default connection open to ' + dbURI); | ||
}); | ||
|
||
// If the connection throws an error | ||
mongoose.connection.on('error', function(err) { | ||
console.log('Mongoose default connection error: ' + err); | ||
}); | ||
|
||
// When the connection is disconnected | ||
mongoose.connection.on('reconnect', function() { | ||
console.log('Mongoose Reconected' + new Date()); | ||
}); | ||
|
||
mongoose.connection.on('disconnected', function() { | ||
console.log('Mongoodb disconnected...trying to reconnect ' + new Date()); | ||
mongoose.connect(dbURI); | ||
}); | ||
|
||
module.exports = mongoose; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
var Cms = require('./components/Cms.react'); | ||
var React = require('react'), | ||
Cms = require('./components/Cms.react'); | ||
|
||
// export for http://fb.me/react-devtools, only in development mode | ||
if (process.env.NODE_ENV === 'development') { | ||
window.React = React; | ||
} | ||
|
||
var React = require('react'); | ||
window.React = React; // export for http://fb.me/react-devtools | ||
|
||
|
||
React.render( | ||
<Cms />, | ||
document.body | ||
); | ||
React.render(<Cms />, document.body); |
Oops, something went wrong.