mirror of
https://github.com/DCsunset/taskwarrior-webui.git
synced 2025-08-24 05:56:42 +02:00
feat(backend): add building script and fix paths
This commit is contained in:
parent
380933e710
commit
38c41d0798
3 changed files with 5 additions and 4 deletions
|
@ -4,7 +4,9 @@
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"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",
|
"author": "DCsunset",
|
||||||
"license": "GPL-3.0-or-later",
|
"license": "GPL-3.0-or-later",
|
||||||
|
|
|
@ -10,7 +10,6 @@ router.get('/', async ctx => {
|
||||||
});
|
});
|
||||||
|
|
||||||
router.put('/', async ctx => {
|
router.put('/', async ctx => {
|
||||||
console.log(ctx.request.body.tasks);
|
|
||||||
const msg = taskwarrior.update(ctx.request.body.tasks);
|
const msg = taskwarrior.update(ctx.request.body.tasks);
|
||||||
console.log(msg);
|
console.log(msg);
|
||||||
ctx.status = 200;
|
ctx.status = 200;
|
||||||
|
|
|
@ -4,8 +4,8 @@ import * as path from 'path';
|
||||||
const prod = process.env.NODE_ENV === 'production';
|
const prod = process.env.NODE_ENV === 'production';
|
||||||
|
|
||||||
const taskwarrior = new TaskwarriorLib(
|
const taskwarrior = new TaskwarriorLib(
|
||||||
prod ? '~/.taskrc' : path.join(__dirname, '../test/.taskrc'),
|
prod ? '/.taskrc' : path.join(__dirname, '../test/.taskrc'),
|
||||||
prod ? '~/.task' : path.join(__dirname, '../test/.task'),
|
prod ? '/.task' : path.join(__dirname, '../test/.task'),
|
||||||
);
|
);
|
||||||
|
|
||||||
export default taskwarrior;
|
export default taskwarrior;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue