Skip to content

Instantly share code, notes, and snippets.

View peacemakafui's full-sized avatar

Makafui peacemakafui

View GitHub Profile
@peacemakafui
peacemakafui / taskController.js
Created February 26, 2021 15:49
logic for post and get request for application
const Task = require('../models/Task');
//logic for displaying tasks on home page
const task_board = (request, response)=>{
Task.find().sort({createdAt: -1})
.then((result)=>{
response.render('taskBoard',{title:'All tasks', tasks:result})
console.log('got tasks from db successfully')
})
.catch(error =>console.log(error));
}