feat(backend): add building script and fix paths

This commit is contained in:
DCsunset 2020-07-17 00:40:47 -07:00
parent 380933e710
commit 38c41d0798
3 changed files with 5 additions and 4 deletions

View file

@ -4,7 +4,9 @@
"description": "",
"main": "index.js",
"scripts": {
"dev": "ts-node src/app.ts"
"dev": "ts-node src/app.ts",
"build": "rm -rf dist && tsc",
"start": "node ./dist/app.js"
},
"author": "DCsunset",
"license": "GPL-3.0-or-later",

View file

@ -10,7 +10,6 @@ router.get('/', async ctx => {
});
router.put('/', async ctx => {
console.log(ctx.request.body.tasks);
const msg = taskwarrior.update(ctx.request.body.tasks);
console.log(msg);
ctx.status = 200;

View file

@ -4,8 +4,8 @@ import * as path from 'path';
const prod = process.env.NODE_ENV === 'production';
const taskwarrior = new TaskwarriorLib(
prod ? '~/.taskrc' : path.join(__dirname, '../test/.taskrc'),
prod ? '~/.task' : path.join(__dirname, '../test/.task'),
prod ? '/.taskrc' : path.join(__dirname, '../test/.taskrc'),
prod ? '/.task' : path.join(__dirname, '../test/.task'),
);
export default taskwarrior;