This file contains hidden or 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
var config = require('./conf'), | |
m = require('./model'); | |
var getPosts = function(req, res) { | |
m.models.post.findAll({ | |
order: 'createdAt DESC' | |
}).then(function(result){ | |
res.send(result); | |
}, function(err){ | |
console.log(err); |
This file contains hidden or 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
var Sequelize = require('sequelize'), | |
sequelize = new Sequelize('aes_db', null, null, { | |
host: 'localhost', | |
dialect: 'sqlite', | |
pool: { | |
max: 5, | |
min: 0, | |
idle: 10000 | |
}, | |
storage: './data.sqlite' |
This file contains hidden or 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
var Sequelize = require('sequelize'), | |
c = require('./conf'); | |
var Post = c.config.db.define( 'post', { | |
postTitle: { | |
type: Sequelize.STRING, | |
field: 'post_title' | |
}, | |
postContent: { | |
type: Sequelize.TEXT, |
This file contains hidden or 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
var express = require('express'), | |
r = require('./app/server/route'), | |
app = express(), | |
bodyParser = require('body-parser') | |
app.use(express.static('public')); | |
app.use(bodyParser.json()); | |
app.use(bodyParser.urlencoded({ | |
extended: true | |
})); |
This file contains hidden or 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
{ | |
"child": [ | |
{ | |
"uid": "checklist_one_edited_too_good", | |
"type": "checklist", | |
"name": "Checklist One edited too good", | |
"child": [ | |
{ | |
"uid": "checklist_one_child", | |
"type": "checklist", |
NewerOlder