diff --git a/package.json b/package.json index fd85522..3d95c8f 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0", "preview": "vite preview", "prepare": "chmod +x .husky/pre-commit && chmod +x .husky/commit-msg && husky install", - "pre-commit": "echo \"[Husky] pre-commit\"" + "pre-commit": "echo \"[Husky] pre-commit\"", + "server": "json-server --watch ./database/db.json --routes ./database/routes.json --port 5000" }, "husky": { "hooks": { diff --git a/src/database/db.json b/src/database/db.json new file mode 100644 index 0000000..4aefd4c --- /dev/null +++ b/src/database/db.json @@ -0,0 +1,59 @@ +{ + "todos": [ + { + "title": "Nguyễn Tiến Tài", + "completed": false, + "id": 1 + }, + { + "title": "Nguyễn Võ Tiền", + "completed": false, + "id": 2 + }, + { + "title": "Lê Ngọc Trâm Anh", + "completed": false, + "id": 3 + }, + { + "title": "Nguyễn Quốc Hào", + "completed": false, + "id": 4 + }, + { + "title": "Nguyễn Thanh Phong", + "completed": false, + "id": 5 + }, + { + "title": "Trương Tấn Ngĩa", + "completed": false, + "id": 6 + }, + { + "title": "Tấn Nguyễn", + "completed": false, + "id": 7 + }, + { + "title": "Hải Nam", + "completed": false, + "id": 8 + }, + { + "title": "Nguyễn Văn C", + "completed": true, + "id": 11 + }, + { + "title": "Nguyễn Văn D", + "completed": true, + "id": 12 + }, + { + "title": "Nguyên Văn A", + "completed": true, + "id": 13 + } + ] +} \ No newline at end of file diff --git a/src/database/routes.json b/src/database/routes.json new file mode 100644 index 0000000..0e6ea09 --- /dev/null +++ b/src/database/routes.json @@ -0,0 +1,4 @@ +{ + "/api/*": "/$1", + "/todos": "/todos" + } \ No newline at end of file