const express = require('express');
const app = express();

let data = [
    {id: 1, title: 'server: taskA', state: 'open'},
    {id: 2, title: 'server: taskB', state: 'done'},
    {id: 3, title: 'server: taskC', state: 'open'}
];

app.get('/tasks', (req, res) => {
    console.log(data);
    res.json(data);
});

app.listen(8080);