mirror of
https://github.com/wassname/HackFlowy.git
synced 2026-08-11 05:38:12 +08:00
Heroku integration with foreman
Add foreman configuration for Heroku: - To test production configuration execute NODE_ENV=production foreman start - Database connection configuration now handles "use_env_variable" which should be defined as a environment variable such as "DATABASE_URL" with a proper database URI connection string, ie: postgres://user:password@db.example.com:5432/database - Added package.json configuration to run migrations and db seed after `npm install` Update frontend models to match sequelize definition. Update views to work according to the changes above. Handling isCompleted and parentId apropiately for PostgreSQL databases
This commit is contained in:
@@ -29,7 +29,7 @@ app.get('/tasks', function(req,res){
|
||||
app.post('/tasks', function(req,res){
|
||||
Tasks.create({
|
||||
content: req.body.content,
|
||||
parent: req.body.parent_id,
|
||||
parent: parseInt(req.body.parent_id) || 0,
|
||||
isCompleted: false
|
||||
}).success(function(task){
|
||||
res.send(task);
|
||||
@@ -40,7 +40,7 @@ app.put('/tasks/:id', function(req,res){
|
||||
console.log(req.body.isCompleted);
|
||||
Tasks.find(req.params.id).success(function(task){
|
||||
task.content = req.body.content;
|
||||
task.isCompleted = req.body.isCompleted;
|
||||
task.isCompleted = req.body.isCompleted == 1;
|
||||
task.save().success(function(task){
|
||||
res.send(task);
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user