add axios call data json

This commit is contained in:
kamoa457 2023-11-07 03:27:08 +07:00
parent fdee2f0401
commit 659d6099f0
21 changed files with 1797 additions and 172 deletions

15
appserver/db.js Normal file
View File

@ -0,0 +1,15 @@
var users = require('./users.json');
// var secondRoute = require('./jsonfile2.json');
// var thirdRoute = require('./jsonfile3.json');
// var fourthRoute = require('./jsonfile4.json');
// and so on
module.exports = function() {
return {
users : users,
// secondRoute : secondRoute,
// thirdRoute : thirdRoute,
// fourthRoute : fourthRoute
// and so on
}
}

View File

@ -1,3 +1,4 @@
{
"users": [
{

361
appserver/masterData.json Normal file
View File

@ -0,0 +1,361 @@
{
"ranks": [
{
"label": "นาย",
"value": "นาย"
},
{
"label": "นาง",
"value": "นาง"
},
{
"label": "นางสาว",
"value": "นางสาว"
}
],
"ranks2": [
{
"label": "ส.ต.ต.",
"value": "ส.ต.ต."
},
{
"label": "ส.ต.ต.หญิง",
"value": "ส.ต.ต.หญิง"
},
{
"label": "ส.ต.ท.",
"value": "ส.ต.ท."
},
{
"label": "ส.ต.ท.หญิง",
"value": "ส.ต.ท.หญิง"
},
{
"label": "ส.ต.อ.",
"value": "ส.ต.อ."
},
{
"label": "ส.ต.อ.หญิง",
"value": "ส.ต.อ.หญิง"
},
{
"label": "จ.ส.ต.",
"value": "จ.ส.ต."
},
{
"label": "จ.ส.ต.หญิง",
"value": "จ.ส.ต.หญิง"
},
{
"label": "ด.ต.",
"value": "ด.ต."
},
{
"label": "ด.ต.หญิง",
"value": "ด.ต.หญิง"
}
],
"ranks3": [
{
"label": "ร.ต.ต.",
"value": "ร.ต.ต."
},
{
"label": "ร.ต.ต.หญิง",
"value": "ร.ต.ต.หญิง"
},
{
"label": "ร.ต.ท.",
"value": "ร.ต.ท."
},
{
"label": "ร.ต.ท.หญิง",
"value": "ร.ต.ท.หญิง"
},
{
"label": "ร.ต.อ.",
"value": "ร.ต.อ."
},
{
"label": "ร.ต.อ.หญิง",
"value": "ร.ต.อ.หญิง"
},
{
"label": "พ.ต.ต.",
"value": "พ.ต.ต."
},
{
"label": "พ.ต.ต.หญิง",
"value": "พ.ต.ต.หญิง"
},
{
"label": "พ.ต.ท.",
"value": "พ.ต.ท."
},
{
"label": "พ.ต.ท.หญิง",
"value": "พ.ต.ท.หญิง"
},
{
"label": "พ.ต.อ.",
"value": "พ.ต.อ."
},
{
"label": "พ.ต.อ.หญิง",
"value": "พ.ต.อ.หญิง"
},
{
"label": "พล.ต.ต.",
"value": "พล.ต.ต."
},
{
"label": "พล.ต.ท.",
"value": "พล.ต.ท."
},
{
"label": "พล.ต.อ.",
"value": "พล.ต.อ."
}
],
"position": [
{
"label": "รอง สว.",
"value": "รอง สว."
},
{
"label": "สว.",
"value": "สว."
},
{
"label": "รอง ผกก.",
"value": "รอง ผกก."
},
{
"label": "ผกก.",
"value": "ผกก."
},
{
"label": "รอง ผบก.",
"value": "รอง ผบก."
},
{
"label": "ผบก.",
"value": "ผบก."
},
{
"label": "รอง ผบช.",
"value": "รอง ผบช."
},
{
"label": "ผบช.",
"value": "ผบช."
},
{
"label": "ผบ.หมู่",
"value": "ผบ.หมู่"
}
],
"Affiliation": [
{
"label": "บก.อก.",
"value": "บก.อก."
},
{
"label": "ฝอ.1",
"value": "ฝอ.1"
},
{
"label": "ฝอ.2",
"value": "ฝอ.2"
},
{
"label": "ฝอ.3",
"value": "ฝอ.3"
},
{
"label": "ฝอ.4",
"value": "ฝอ.4"
},
{
"label": "ฝอ.5",
"value": "ฝอ.5"
},
{
"label": "ฝอ.6",
"value": "ฝอ.6"
},
{
"label": "ฝอ.7",
"value": "ฝอ.7"
},
{
"label": "ฝอ.8",
"value": "ฝอ.8"
}
],
"Affiliation2": [
{
"label": "บก.สนน.",
"value": "บก.สสน."
},
{
"label": "ฝสสน.1",
"value": "ฝสสน.1"
},
{
"label": "ฝสสน.2",
"value": "ฝสสน.2"
},
{
"label": "ฝสสน.3",
"value": "ฝสสน.3"
},
{
"label": "ฝสสน.4",
"value": "ฝสสน.4"
},
{
"label": "ฝสสน.5",
"value": "ฝสสน.5"
}
],
"building": [
{
"buil": "อาคารบ้านพัก บช. ตชด.",
"name": "อาคารแฟลต 1/11",
"room": "24",
"floor": "4",
"roomnumber": "12,13",
"type": "ช.2"
},
{
"buil": "อาคารบ้านพัก บช. ตชด.",
"name": "อาคารแฟลต 1/12",
"room": "20",
"floor": "4",
"roomnumber": "12,13",
"type": "ช.2"
},
{
"buil": "อาคารบ้านพัก บช. ตชด.",
"name": "อาคารแฟลต 1/13",
"room": "24",
"floor": "4",
"roomnumber": "12,13",
"type": "ช.2"
},
{
"buil": "อาคารบ้านพัก บช. ตชด.",
"name": "อาคารแฟลต 1/14",
"room": "18",
"floor": "3",
"roomnumber": "12,13",
"type": "ช.3"
},
{
"buil": "อาคารบ้านพัก บช. ตชด.",
"name": "อาคารแฟลต 1/15",
"room": "32",
"floor": "4",
"roomnumber": "12,13",
"type": "ช.2"
},
{
"buil": "อาคารบ้านพัก บช. ตชด.",
"name": "อาคารแฟลต 1/16",
"room": "24",
"floor": "4",
"roomnumber": "12,13",
"type": "ช.2"
},
{
"buil": "อาคารบ้านพัก บช. ตชด.",
"name": "อาคารแฟลต 1/17",
"room": "32",
"floor": "4",
"roomnumber": "12,13",
"type": "ช.2"
},
{
"buil": "อาคารบ้านพัก บช. ตชด.",
"name": "อาคารแฟลต 1/18",
"room": "60",
"floor": "5",
"roomnumber": "12,13",
"type": "-"
},
{
"buil": "อาคารบ้านพัก บช. ตชด.",
"name": "แฟลตลือชา 1",
"room": "50",
"floor": "5",
"roomnumber": "12,13",
"type": "-"
},
{
"buil": "อาคารบ้านพัก บช. ตชด.",
"name": "แฟลตลือชา 2",
"room": "50",
"floor": "5",
"roomnumber": "12,13",
"type": "-"
},
{
"buil": "อาคารบ้านพัก บช. ตชด.",
"name": "แฟลตลือชา 3",
"room": "40",
"floor": "5",
"roomnumber": "12,13",
"type": "ช.2"
},
{
"buil": "อาคารบ้านพัก บช. ตชด.",
"name": "แฟลตบางเขน 1",
"room": "50",
"floor": "5",
"roomnumber": "12,13",
"type": "-"
},
{
"buil": "อาคารบ้านพัก บช. ตชด.",
"name": "แฟลตบางเขน 2",
"room": "50",
"floor": "5",
"roomnumber": "12,13",
"type": "ช.2"
}
],
"typeranks": [
{
"label": "ลูกจ้าง",
"value": "ลูกจ้าง"
},
{
"label": "ประทวน",
"value": "ประทวน"
},
{
"label": "สัญญาบัตร",
"value": "สัญญาบัตร"
}
],
"typeAffiliation": [
{
"label": "ลูกจ้าง",
"value": "ลูกจ้าง"
},
{
"label": "บช.ตซด.",
"value": "บช.ตซด."
},
{
"label": "บก.อก.",
"value": "บก.อก."
},
{
"label": "บก.สนน.",
"value": "บก.สนน."
}
]
}

View File

@ -9,9 +9,18 @@
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"json-server": "^0.17.4"
"cors": "^2.8.5",
"fs": "^0.0.1-security",
"json-server": "^0.17.4",
"nodemon": "^3.0.1",
"uuid": "^9.0.1"
}
},
"node_modules/abbrev": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q=="
},
"node_modules/accepts": {
"version": "1.3.8",
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
@ -46,11 +55,28 @@
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/anymatch": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz",
"integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==",
"dependencies": {
"normalize-path": "^3.0.0",
"picomatch": "^2.0.4"
},
"engines": {
"node": ">= 8"
}
},
"node_modules/array-flatten": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
"integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg=="
},
"node_modules/balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
},
"node_modules/basic-auth": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz",
@ -62,6 +88,14 @@
"node": ">= 0.8"
}
},
"node_modules/binary-extensions": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz",
"integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==",
"engines": {
"node": ">=8"
}
},
"node_modules/body-parser": {
"version": "1.20.2",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz",
@ -85,6 +119,26 @@
"npm": "1.2.8000 || >= 1.4.16"
}
},
"node_modules/brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"dependencies": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
}
},
"node_modules/braces": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
"dependencies": {
"fill-range": "^7.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/bytes": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
@ -121,6 +175,32 @@
"url": "https://github.com/chalk/chalk?sponsor=1"
}
},
"node_modules/chokidar": {
"version": "3.5.3",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
"integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==",
"funding": [
{
"type": "individual",
"url": "https://paulmillr.com/funding/"
}
],
"dependencies": {
"anymatch": "~3.1.2",
"braces": "~3.0.2",
"glob-parent": "~5.1.2",
"is-binary-path": "~2.1.0",
"is-glob": "~4.0.1",
"normalize-path": "~3.0.0",
"readdirp": "~3.6.0"
},
"engines": {
"node": ">= 8.10.0"
},
"optionalDependencies": {
"fsevents": "~2.3.2"
}
},
"node_modules/cliui": {
"version": "8.0.1",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz",
@ -186,6 +266,11 @@
"node": ">= 0.8"
}
},
"node_modules/concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="
},
"node_modules/connect-pause": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/connect-pause/-/connect-pause-0.1.1.tgz",
@ -460,6 +545,17 @@
}
]
},
"node_modules/fill-range": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
"dependencies": {
"to-regex-range": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/finalhandler": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz",
@ -493,6 +589,24 @@
"node": ">= 0.6"
}
},
"node_modules/fs": {
"version": "0.0.1-security",
"resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz",
"integrity": "sha512-3XY9e1pP0CVEUCdj5BmfIZxRBTSDycnbqhIOGec9QYtmVH2fbLpj86CFWkrNOkt/Fvty4KZG5lTglL9j/gJ87w=="
},
"node_modules/fsevents": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
"hasInstallScript": true,
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
}
},
"node_modules/function-bind": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
@ -523,6 +637,17 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/glob-parent": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
"dependencies": {
"is-glob": "^4.0.1"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/gopd": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz",
@ -617,6 +742,11 @@
"node": ">=0.10.0"
}
},
"node_modules/ignore-by-default": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz",
"integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA=="
},
"node_modules/inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
@ -630,6 +760,25 @@
"node": ">= 0.10"
}
},
"node_modules/is-binary-path": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
"integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
"dependencies": {
"binary-extensions": "^2.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/is-extglob": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
"integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
@ -638,6 +787,25 @@
"node": ">=8"
}
},
"node_modules/is-glob": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
"integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
"dependencies": {
"is-extglob": "^2.1.1"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/is-number": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
"engines": {
"node": ">=0.12.0"
}
},
"node_modules/is-promise": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz",
@ -721,6 +889,17 @@
"node": ">=4"
}
},
"node_modules/lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
"dependencies": {
"yallist": "^4.0.0"
},
"engines": {
"node": ">=10"
}
},
"node_modules/media-typer": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
@ -794,6 +973,17 @@
"node": ">= 0.6"
}
},
"node_modules/minimatch": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
"dependencies": {
"brace-expansion": "^1.1.7"
},
"engines": {
"node": "*"
}
},
"node_modules/morgan": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz",
@ -850,6 +1040,87 @@
"node": ">= 0.6"
}
},
"node_modules/nodemon": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.0.1.tgz",
"integrity": "sha512-g9AZ7HmkhQkqXkRc20w+ZfQ73cHLbE8hnPbtaFbFtCumZsjyMhKk9LajQ07U5Ux28lvFjZ5X7HvWR1xzU8jHVw==",
"dependencies": {
"chokidar": "^3.5.2",
"debug": "^3.2.7",
"ignore-by-default": "^1.0.1",
"minimatch": "^3.1.2",
"pstree.remy": "^1.1.8",
"semver": "^7.5.3",
"simple-update-notifier": "^2.0.0",
"supports-color": "^5.5.0",
"touch": "^3.1.0",
"undefsafe": "^2.0.5"
},
"bin": {
"nodemon": "bin/nodemon.js"
},
"engines": {
"node": ">=10"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/nodemon"
}
},
"node_modules/nodemon/node_modules/debug": {
"version": "3.2.7",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
"integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
"dependencies": {
"ms": "^2.1.1"
}
},
"node_modules/nodemon/node_modules/has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
"engines": {
"node": ">=4"
}
},
"node_modules/nodemon/node_modules/ms": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
},
"node_modules/nodemon/node_modules/supports-color": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
"dependencies": {
"has-flag": "^3.0.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/nopt": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz",
"integrity": "sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==",
"dependencies": {
"abbrev": "1"
},
"bin": {
"nopt": "bin/nopt.js"
},
"engines": {
"node": "*"
}
},
"node_modules/normalize-path": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
"integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/object-assign": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
@ -898,6 +1169,17 @@
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
"integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ=="
},
"node_modules/picomatch": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
"engines": {
"node": ">=8.6"
},
"funding": {
"url": "https://github.com/sponsors/jonschlinkert"
}
},
"node_modules/pify": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
@ -934,6 +1216,11 @@
"node": ">= 0.10"
}
},
"node_modules/pstree.remy": {
"version": "1.1.8",
"resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz",
"integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w=="
},
"node_modules/qs": {
"version": "6.11.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
@ -970,6 +1257,17 @@
"node": ">= 0.8"
}
},
"node_modules/readdirp": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
"integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
"dependencies": {
"picomatch": "^2.2.1"
},
"engines": {
"node": ">=8.10.0"
}
},
"node_modules/require-directory": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
@ -988,6 +1286,20 @@
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
},
"node_modules/semver": {
"version": "7.5.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
"integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"dependencies": {
"lru-cache": "^6.0.0"
},
"bin": {
"semver": "bin/semver.js"
},
"engines": {
"node": ">=10"
}
},
"node_modules/semver-compare": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz",
@ -1072,6 +1384,17 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/simple-update-notifier": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz",
"integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==",
"dependencies": {
"semver": "^7.5.3"
},
"engines": {
"node": ">=10"
}
},
"node_modules/statuses": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
@ -1123,6 +1446,17 @@
"node": ">=8"
}
},
"node_modules/to-regex-range": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
"dependencies": {
"is-number": "^7.0.0"
},
"engines": {
"node": ">=8.0"
}
},
"node_modules/toidentifier": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
@ -1131,6 +1465,17 @@
"node": ">=0.6"
}
},
"node_modules/touch": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz",
"integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==",
"dependencies": {
"nopt": "~1.0.10"
},
"bin": {
"nodetouch": "bin/nodetouch.js"
}
},
"node_modules/type-is": {
"version": "1.6.18",
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
@ -1143,6 +1488,11 @@
"node": ">= 0.6"
}
},
"node_modules/undefsafe": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz",
"integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA=="
},
"node_modules/unpipe": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
@ -1159,6 +1509,18 @@
"node": ">= 0.4.0"
}
},
"node_modules/uuid": {
"version": "9.0.1",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz",
"integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==",
"funding": [
"https://github.com/sponsors/broofa",
"https://github.com/sponsors/ctavan"
],
"bin": {
"uuid": "dist/bin/uuid"
}
},
"node_modules/vary": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
@ -1191,6 +1553,11 @@
"node": ">=10"
}
},
"node_modules/yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
},
"node_modules/yargs": {
"version": "17.7.2",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz",
@ -1218,6 +1585,11 @@
}
},
"dependencies": {
"abbrev": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q=="
},
"accepts": {
"version": "1.3.8",
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
@ -1240,11 +1612,25 @@
"color-convert": "^2.0.1"
}
},
"anymatch": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz",
"integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==",
"requires": {
"normalize-path": "^3.0.0",
"picomatch": "^2.0.4"
}
},
"array-flatten": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
"integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg=="
},
"balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
},
"basic-auth": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz",
@ -1253,6 +1639,11 @@
"safe-buffer": "5.1.2"
}
},
"binary-extensions": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz",
"integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA=="
},
"body-parser": {
"version": "1.20.2",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz",
@ -1272,6 +1663,23 @@
"unpipe": "1.0.0"
}
},
"brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
}
},
"braces": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
"requires": {
"fill-range": "^7.0.1"
}
},
"bytes": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
@ -1296,6 +1704,21 @@
"supports-color": "^7.1.0"
}
},
"chokidar": {
"version": "3.5.3",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
"integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==",
"requires": {
"anymatch": "~3.1.2",
"braces": "~3.0.2",
"fsevents": "~2.3.2",
"glob-parent": "~5.1.2",
"is-binary-path": "~2.1.0",
"is-glob": "~4.0.1",
"normalize-path": "~3.0.0",
"readdirp": "~3.6.0"
}
},
"cliui": {
"version": "8.0.1",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz",
@ -1348,6 +1771,11 @@
}
}
},
"concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="
},
"connect-pause": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/connect-pause/-/connect-pause-0.1.1.tgz",
@ -1553,6 +1981,14 @@
}
}
},
"fill-range": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
"requires": {
"to-regex-range": "^5.0.1"
}
},
"finalhandler": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz",
@ -1577,6 +2013,17 @@
"resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
"integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q=="
},
"fs": {
"version": "0.0.1-security",
"resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz",
"integrity": "sha512-3XY9e1pP0CVEUCdj5BmfIZxRBTSDycnbqhIOGec9QYtmVH2fbLpj86CFWkrNOkt/Fvty4KZG5lTglL9j/gJ87w=="
},
"fsevents": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
"optional": true
},
"function-bind": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
@ -1598,6 +2045,14 @@
"hasown": "^2.0.0"
}
},
"glob-parent": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
"requires": {
"is-glob": "^4.0.1"
}
},
"gopd": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz",
@ -1662,6 +2117,11 @@
"safer-buffer": ">= 2.1.2 < 3"
}
},
"ignore-by-default": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz",
"integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA=="
},
"inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
@ -1672,11 +2132,37 @@
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
"integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g=="
},
"is-binary-path": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
"integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
"requires": {
"binary-extensions": "^2.0.0"
}
},
"is-extglob": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
"integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ=="
},
"is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="
},
"is-glob": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
"integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
"requires": {
"is-extglob": "^2.1.1"
}
},
"is-number": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng=="
},
"is-promise": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz",
@ -1748,6 +2234,14 @@
"steno": "^0.4.1"
}
},
"lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
"requires": {
"yallist": "^4.0.0"
}
},
"media-typer": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
@ -1802,6 +2296,14 @@
"mime-db": "1.52.0"
}
},
"minimatch": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
"requires": {
"brace-expansion": "^1.1.7"
}
},
"morgan": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz",
@ -1839,6 +2341,64 @@
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
"integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg=="
},
"nodemon": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.0.1.tgz",
"integrity": "sha512-g9AZ7HmkhQkqXkRc20w+ZfQ73cHLbE8hnPbtaFbFtCumZsjyMhKk9LajQ07U5Ux28lvFjZ5X7HvWR1xzU8jHVw==",
"requires": {
"chokidar": "^3.5.2",
"debug": "^3.2.7",
"ignore-by-default": "^1.0.1",
"minimatch": "^3.1.2",
"pstree.remy": "^1.1.8",
"semver": "^7.5.3",
"simple-update-notifier": "^2.0.0",
"supports-color": "^5.5.0",
"touch": "^3.1.0",
"undefsafe": "^2.0.5"
},
"dependencies": {
"debug": {
"version": "3.2.7",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
"integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
"requires": {
"ms": "^2.1.1"
}
},
"has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw=="
},
"ms": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
},
"supports-color": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
"requires": {
"has-flag": "^3.0.0"
}
}
}
},
"nopt": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz",
"integrity": "sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==",
"requires": {
"abbrev": "1"
}
},
"normalize-path": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
"integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA=="
},
"object-assign": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
@ -1872,6 +2432,11 @@
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
"integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ=="
},
"picomatch": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="
},
"pify": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
@ -1899,6 +2464,11 @@
"ipaddr.js": "1.9.1"
}
},
"pstree.remy": {
"version": "1.1.8",
"resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz",
"integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w=="
},
"qs": {
"version": "6.11.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
@ -1923,6 +2493,14 @@
"unpipe": "1.0.0"
}
},
"readdirp": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
"integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
"requires": {
"picomatch": "^2.2.1"
}
},
"require-directory": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
@ -1938,6 +2516,14 @@
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
},
"semver": {
"version": "7.5.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
"integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"requires": {
"lru-cache": "^6.0.0"
}
},
"semver-compare": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz",
@ -2012,6 +2598,14 @@
"object-inspect": "^1.9.0"
}
},
"simple-update-notifier": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz",
"integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==",
"requires": {
"semver": "^7.5.3"
}
},
"statuses": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
@ -2051,11 +2645,27 @@
"has-flag": "^4.0.0"
}
},
"to-regex-range": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
"requires": {
"is-number": "^7.0.0"
}
},
"toidentifier": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
"integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA=="
},
"touch": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz",
"integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==",
"requires": {
"nopt": "~1.0.10"
}
},
"type-is": {
"version": "1.6.18",
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
@ -2065,6 +2675,11 @@
"mime-types": "~2.1.24"
}
},
"undefsafe": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz",
"integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA=="
},
"unpipe": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
@ -2075,6 +2690,11 @@
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
"integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA=="
},
"uuid": {
"version": "9.0.1",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz",
"integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA=="
},
"vary": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
@ -2095,6 +2715,11 @@
"resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
"integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA=="
},
"yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
},
"yargs": {
"version": "17.7.2",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz",

View File

@ -5,12 +5,16 @@
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"server": "node server.js"
"server": "nodemon server.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"json-server": "^0.17.4"
"cors": "^2.8.5",
"fs": "^0.0.1-security",
"json-server": "^0.17.4",
"nodemon": "^3.0.1",
"uuid": "^9.0.1"
}
}

1
appserver/queue.json Normal file
View File

@ -0,0 +1 @@
[{"id":"3f7e1c45-a2e9-4b08-a56d-e687ea79ba61","firstName":"สมชัย14","lastName":"แสงสุข","affiliation":"ลูกจ้าง","rank":"นาง","idcard":"134044411441178","phone":"0325647845","status":"โสด","typeAffiliation":"ลูกจ้าง","typeRanks":"ลูกจ้าง","bookNumber":"1234"},{"id":"8e81c39a-d50c-42f5-85c0-f9f773c2a4aa","firstName":"สมชัย","lastName":"แสงสุข","affiliation":"บช.ตซด.","rank":"ส.ต.อ.","idcard":"134044411441178","phone":"0325647845","typeAffiliation":"บช.ตซด.","typeRanks":"ประทวน","bookNumber":"1234"},{"id":"ebd367bf-396f-4bae-8130-1ce3fa130d38","firstName":"สมชัย","lastName":"แสงสุข","affiliation":"ลูกจ้าง","rank":"นาง","idcard":"134044411441178","phone":"0325647845","status":"โสด","typeAffiliation":"ลูกจ้าง","typeRanks":"ลูกจ้าง","bookNumber":"1234"},{"id":"46685cde-8ea0-4cd2-ba94-7d86e6e893bd","firstName":"สมชัย","lastName":"แสงสุข","affiliation":"บช.ตซด.","rank":"ส.ต.อ.","idcard":"134044411441178","phone":"0325647845","typeAffiliation":"บช.ตซด.","typeRanks":"ประทวน","bookNumber":"14578963"},{"id":"e9aa568a-bb68-4ff9-bb3a-3751f275b631","firstName":"สมชัย14","lastName":"แสงสุข","affiliation":"ลูกจ้าง","rank":"นาง","idcard":"134044411441178","phone":"0325647845","status":"โสด","typeAffiliation":"ลูกจ้าง","typeRanks":"ลูกจ้าง","bookNumber":"787878"},{"id":"a8e392df-f6e0-4363-9c36-b6c28d6ab8c8","firstName":"สมชัย14","lastName":"แสงสุข","affiliation":"ลูกจ้าง","rank":"นาง","idcard":"134044411441178","phone":"0325647845","status":"โสด","typeAffiliation":"ลูกจ้าง","typeRanks":"ลูกจ้าง","bookNumber":"7889999999"}]

132
appserver/rooms.json Normal file
View File

@ -0,0 +1,132 @@
[
{
"title": "ห้อง 1",
"dataIndex": "1",
"ranks": "",
"firstName": "",
"laststName": "",
"Affiliation": "",
"typeRoom": "ช1",
"status": "free"
},
{
"title": "ห้อง 2",
"dataIndex": "2",
"ranks": "ส.ต.ต.",
"firstName": "ปิติ2",
"laststName": "มีดี",
"Affiliation": "ฝอ. 2",
"typeRoom": "ช1",
"status": "unavailable"
},
{
"title": "ห้อง 3",
"dataIndex": "3",
"ranks": "",
"firstName": "",
"laststName": "",
"Affiliation": "",
"typeRoom": "ช1",
"status": "free"
},
{
"title": "ห้อง 4",
"dataIndex": "4",
"ranks": "ส.ต.ต.",
"firstName": "ปิติ2",
"laststName": "มีดี",
"Affiliation": "ฝอ. 1",
"typeRoom": "ช2",
"status": "return"
},
{
"title": "ห้อง 5",
"dataIndex": "5",
"ranks": "ส.ต.ต.",
"firstName": "ปิติ3",
"laststName": "มีดี",
"Affiliation": "ฝอ. 1",
"typeRoom": "ช2",
"status": "unavailable"
},
{
"title": "ห้อง 6",
"dataIndex": "6",
"ranks": "ส.ต.ต.",
"firstName": "ปิติ4",
"laststName": "มีดี",
"Affiliation": "ฝอ. 1",
"typeRoom": "ช3",
"status": "waiting"
},
{
"title": "ห้อง 7",
"dataIndex": "7",
"ranks": "ส.ต.ต.",
"firstName": "ปิติ3",
"laststName": "มีดี",
"Affiliation": "ฝอ. 1",
"typeRoom": "ช1",
"status": "return"
},
{
"title": "ห้อง 8",
"dataIndex": "8",
"ranks": "ส.ต.ต.",
"firstName": "ปิติ9",
"laststName": "มีดี",
"Affiliation": "ฝอ. 1",
"typeRoom": "ช3",
"status": "special"
},
{
"title": "ห้อง 9",
"dataIndex": "9",
"ranks": "ส.ต.ต.",
"firstName": "ปิติ5",
"laststName": "มีดี",
"Affiliation": "ฝอ. 4",
"typeRoom": "ช2",
"status": "unavailable"
},
{
"title": "ห้อง 10",
"dataIndex": "10",
"ranks": "ส.ต.ต.",
"firstName": "ปิติ6",
"laststName": "มีดี",
"Affiliation": "ฝอ. 7",
"typeRoom": "ช2",
"status": "waiting"
},
{
"title": "ห้อง 11",
"dataIndex": "11",
"ranks": "",
"firstName": "",
"laststName": "",
"Affiliation": "",
"typeRoom": "ช1",
"status": "free"
},
{
"title": "ห้อง 12",
"dataIndex": "12",
"ranks": "",
"firstName": "",
"laststName": "",
"Affiliation": "",
"typeRoom": "ช2",
"status": "free"
},
{
"title": "ห้อง 13",
"dataIndex": "13",
"ranks": "ส.ต.ต.",
"firstName": "ปิติ7",
"laststName": "มีดี",
"Affiliation": "ฝอ. 2",
"typeRoom": "ช3",
"status": "special"
}
]

View File

@ -1,14 +1,336 @@
const jsonServer = require('json-server')
const server = jsonServer.create()
const router = jsonServer.router('db.json')
const middlewares = jsonServer.defaults()
const users = require('./users.json')
const rooms = require('./rooms.json')
const queue = require('./queue.json')
const masterData = require('./masterData.json')
const express = require("express");
const app = express();
const cors = require("cors");
const port = process.env.PORT || 3001;
const fs = require("fs");
const { v4: uuidv4 } = require('uuid');
// - เวอร์ชั่น Express 4.16.0+ ขึ้นไป
app.use(express.json())
app.use(express.urlencoded({ extended: true }))
app.options('*', cors())
server.use(middlewares)
server.use(router)
app.get("/", (req, res) => {
res.send("Hello! Node.js");
});
app.get('/users', (req, res) => {
res.header("Access-Control-Allow-Origin", "*");
res.json(users)
})
app.get('/users/:id', (req, res) => {
res.header("Access-Control-Allow-Origin", "*");
res.json(users.find(user => user.id === (req.params.id)))
})
app.post('/users', (req, res) => {
res.header("Access-Control-Allow-Origin", "*");
let id = uuidv4();
let body = req.body
let data = { id: id, ...body }
users.push(data)
fs.writeFile('./users.json', JSON.stringify(users), err => {
if (err) {
console.log('Error writing file', err)
} else {
console.log('Successfully wrote file', users)
}
})
res.json(users)
})
app.put('/users/:id', (req, res) => {
res.header("Access-Control-Allow-Origin", "*");
const updateIndex = users.findIndex(user => user.id === (req.params.id))
let dataOld = users[updateIndex]
let filterdata = users.filter(user => user.id !== (req.params.id))
const parsedData = dataOld;
if (req.body.firstName) parsedData.firstName = req.body.firstName
if (req.body.lastName) parsedData.lastName = req.body.lastName
if (req.body.affiliation) parsedData.affiliation = req.body.affiliation
if (req.body.rank) parsedData.rank = req.body.rank
if (req.body.idcard) parsedData.idcard = req.body.idcard
if (req.body.phone) parsedData.phone = req.body.phone
if (req.body.status) parsedData.status = req.body.status
if (req.body.typeAffiliation) parsedData.typeAffiliation = req.body.typeAffiliation
if (req.body.typeRanks) parsedData.typeRanks = req.body.typeRanks
filterdata.push(parsedData)
fs.writeFile('./users.json', JSON.stringify(filterdata, null, 2), (err) => {
if (err) {
console.log("Failed to write updated data to file");
return;
}
console.log("Updated file successfully");
});
res.send(`Update user id: '${req.params.id}' completed.`)
})
app.delete('/users/:id', (req, res) => {
const deletedIndex = users.findIndex(user => user.id === Number(req.params.id))
res.send(`Delete user '${users[deletedIndex].username}' completed.`)
})
const port = process.env.PORT || 3001
app.get('/room', (req, res) => {
res.header("Access-Control-Allow-Origin", "*");
res.json(users)
})
app.get('/room/:id', (req, res) => {
res.header("Access-Control-Allow-Origin", "*");
res.json(users.find(user => user.id === (req.params.id)))
})
app.post('/room', (req, res) => {
res.header("Access-Control-Allow-Origin", "*");
let id = uuidv4();
let body = req.body
let data = { id: id, ...body }
users.push(data)
fs.writeFile('./users.json', JSON.stringify(users), err => {
if (err) {
console.log('Error writing file', err)
} else {
console.log('Successfully wrote file', users)
}
})
res.json(users)
})
app.put('/room/:id', (req, res) => {
res.header("Access-Control-Allow-Origin", "*");
const updateIndex = users.findIndex(user => user.id === (req.params.id))
let dataOld = users[updateIndex]
let filterdata = users.filter(user => user.id !== (req.params.id))
const parsedData = dataOld;
if (req.body.firstName) parsedData.firstName = req.body.firstName
if (req.body.lastName) parsedData.lastName = req.body.lastName
if (req.body.affiliation) parsedData.affiliation = req.body.affiliation
if (req.body.rank) parsedData.rank = req.body.rank
if (req.body.idcard) parsedData.idcard = req.body.idcard
if (req.body.phone) parsedData.phone = req.body.phone
if (req.body.status) parsedData.status = req.body.status
if (req.body.typeAffiliation) parsedData.typeAffiliation = req.body.typeAffiliation
if (req.body.typeRanks) parsedData.typeRanks = req.body.typeRanks
filterdata.push(parsedData)
fs.writeFile('./users.json', JSON.stringify(filterdata, null, 2), (err) => {
if (err) {
console.log("Failed to write updated data to file");
return;
}
console.log("Updated file successfully");
});
res.send(`Update user id: '${req.params.id}' completed.`)
})
server.listen(port, () => {
console.log(`JSON Server is running on port ${port}`)
})
app.get('/queue', (req, res) => {
res.header("Access-Control-Allow-Origin", "*");
res.json(queue)
})
app.get('/queue/:id', (req, res) => {
res.header("Access-Control-Allow-Origin", "*");
res.json(queue.find(queue => queue.id === (req.params.id)))
})
app.post('/queue', (req, res) => {
res.header("Access-Control-Allow-Origin", "*");
let id = uuidv4();
let body = req.body
let data = { id: id, ...body }
queue.push(data)
fs.writeFile('./queue.json', JSON.stringify(queue), err => {
if (err) {
console.log('Error writing file', err)
} else {
console.log('Successfully wrote file', queue)
}
})
res.json(queue)
})
app.put('/queue/:id', (req, res) => {
res.header("Access-Control-Allow-Origin", "*");
const updateIndex = users.findIndex(user => user.id === (req.params.id))
let dataOld = users[updateIndex]
let filterdata = users.filter(user => user.id !== (req.params.id))
const parsedData = dataOld;
if (req.body.firstName) parsedData.firstName = req.body.firstName
if (req.body.lastName) parsedData.lastName = req.body.lastName
if (req.body.affiliation) parsedData.affiliation = req.body.affiliation
if (req.body.rank) parsedData.rank = req.body.rank
if (req.body.idcard) parsedData.idcard = req.body.idcard
if (req.body.phone) parsedData.phone = req.body.phone
if (req.body.status) parsedData.status = req.body.status
if (req.body.typeAffiliation) parsedData.typeAffiliation = req.body.typeAffiliation
if (req.body.typeRanks) parsedData.typeRanks = req.body.typeRanks
filterdata.push(parsedData)
fs.writeFile('./users.json', JSON.stringify(filterdata, null, 2), (err) => {
if (err) {
console.log("Failed to write updated data to file");
return;
}
console.log("Updated file successfully");
});
res.send(`Update user id: '${req.params.id}' completed.`)
})
app.delete('/queue/:id', (req, res) => {
const deletedIndex = users.findIndex(user => user.id === Number(req.params.id))
res.send(`Delete user '${users[deletedIndex].username}' completed.`)
})
app.get('/layout', (req, res) => {
res.header("Access-Control-Allow-Origin", "*");
res.json(users)
})
app.get('/layout/:id', (req, res) => {
res.header("Access-Control-Allow-Origin", "*");
res.json(users.find(user => user.id === (req.params.id)))
})
app.post('/layout', (req, res) => {
res.header("Access-Control-Allow-Origin", "*");
let id = uuidv4();
let body = req.body
let data = { id: id, ...body }
users.push(data)
fs.writeFile('./users.json', JSON.stringify(users), err => {
if (err) {
console.log('Error writing file', err)
} else {
console.log('Successfully wrote file', users)
}
})
res.json(users)
})
app.put('/layout/:id', (req, res) => {
res.header("Access-Control-Allow-Origin", "*");
const updateIndex = users.findIndex(user => user.id === (req.params.id))
let dataOld = users[updateIndex]
let filterdata = users.filter(user => user.id !== (req.params.id))
const parsedData = dataOld;
if (req.body.firstName) parsedData.firstName = req.body.firstName
if (req.body.lastName) parsedData.lastName = req.body.lastName
if (req.body.affiliation) parsedData.affiliation = req.body.affiliation
if (req.body.rank) parsedData.rank = req.body.rank
if (req.body.idcard) parsedData.idcard = req.body.idcard
if (req.body.phone) parsedData.phone = req.body.phone
if (req.body.status) parsedData.status = req.body.status
if (req.body.typeAffiliation) parsedData.typeAffiliation = req.body.typeAffiliation
if (req.body.typeRanks) parsedData.typeRanks = req.body.typeRanks
filterdata.push(parsedData)
fs.writeFile('./users.json', JSON.stringify(filterdata, null, 2), (err) => {
if (err) {
console.log("Failed to write updated data to file");
return;
}
console.log("Updated file successfully");
});
res.send(`Update user id: '${req.params.id}' completed.`)
})
app.delete('/layout/:id', (req, res) => {
const deletedIndex = users.findIndex(user => user.id === Number(req.params.id))
res.send(`Delete user '${users[deletedIndex].username}' completed.`)
})
app.get('/report', (req, res) => {
res.header("Access-Control-Allow-Origin", "*");
res.json(users)
})
app.get('/report/:id', (req, res) => {
res.header("Access-Control-Allow-Origin", "*");
res.json(users.find(user => user.id === (req.params.id)))
})
app.post('/report', (req, res) => {
res.header("Access-Control-Allow-Origin", "*");
let id = uuidv4();
let body = req.body
let data = { id: id, ...body }
users.push(data)
fs.writeFile('./users.json', JSON.stringify(users), err => {
if (err) {
console.log('Error writing file', err)
} else {
console.log('Successfully wrote file', users)
}
})
res.json(users)
})
app.put('/report/:id', (req, res) => {
res.header("Access-Control-Allow-Origin", "*");
const updateIndex = users.findIndex(user => user.id === (req.params.id))
let dataOld = users[updateIndex]
let filterdata = users.filter(user => user.id !== (req.params.id))
const parsedData = dataOld;
if (req.body.firstName) parsedData.firstName = req.body.firstName
if (req.body.lastName) parsedData.lastName = req.body.lastName
if (req.body.affiliation) parsedData.affiliation = req.body.affiliation
if (req.body.rank) parsedData.rank = req.body.rank
if (req.body.idcard) parsedData.idcard = req.body.idcard
if (req.body.phone) parsedData.phone = req.body.phone
if (req.body.status) parsedData.status = req.body.status
if (req.body.typeAffiliation) parsedData.typeAffiliation = req.body.typeAffiliation
if (req.body.typeRanks) parsedData.typeRanks = req.body.typeRanks
filterdata.push(parsedData)
fs.writeFile('./users.json', JSON.stringify(filterdata, null, 2), (err) => {
if (err) {
console.log("Failed to write updated data to file");
return;
}
console.log("Updated file successfully");
});
res.send(`Update user id: '${req.params.id}' completed.`)
})
app.delete('/report/:id', (req, res) => {
const deletedIndex = users.findIndex(user => user.id === Number(req.params.id))
res.send(`Delete user '${users[deletedIndex].username}' completed.`)
})
app.get('/utilitie', (req, res) => {
res.header("Access-Control-Allow-Origin", "*");
res.json(users)
})
app.get('/utilitie/:id', (req, res) => {
res.header("Access-Control-Allow-Origin", "*");
res.json(users.find(user => user.id === (req.params.id)))
})
app.post('/utilitie', (req, res) => {
res.header("Access-Control-Allow-Origin", "*");
let id = uuidv4();
let body = req.body
let data = { id: id, ...body }
users.push(data)
fs.writeFile('./users.json', JSON.stringify(users), err => {
if (err) {
console.log('Error writing file', err)
} else {
console.log('Successfully wrote file', users)
}
})
res.json(users)
})
app.put('/utilitie/:id', (req, res) => {
res.header("Access-Control-Allow-Origin", "*");
const updateIndex = users.findIndex(user => user.id === (req.params.id))
let dataOld = users[updateIndex]
let filterdata = users.filter(user => user.id !== (req.params.id))
const parsedData = dataOld;
if (req.body.firstName) parsedData.firstName = req.body.firstName
if (req.body.lastName) parsedData.lastName = req.body.lastName
if (req.body.affiliation) parsedData.affiliation = req.body.affiliation
if (req.body.rank) parsedData.rank = req.body.rank
if (req.body.idcard) parsedData.idcard = req.body.idcard
if (req.body.phone) parsedData.phone = req.body.phone
if (req.body.status) parsedData.status = req.body.status
if (req.body.typeAffiliation) parsedData.typeAffiliation = req.body.typeAffiliation
if (req.body.typeRanks) parsedData.typeRanks = req.body.typeRanks
filterdata.push(parsedData)
fs.writeFile('./users.json', JSON.stringify(filterdata, null, 2), (err) => {
if (err) {
console.log("Failed to write updated data to file");
return;
}
console.log("Updated file successfully");
});
res.send(`Update user id: '${req.params.id}' completed.`)
})
app.delete('/utilitie/:id', (req, res) => {
const deletedIndex = users.findIndex(user => user.id === Number(req.params.id))
res.send(`Delete user '${users[deletedIndex].username}' completed.`)
})
app.listen(port, () => {
console.log(`Starting node.js at port ${port}`);
});

61
appserver/users.json Normal file
View File

@ -0,0 +1,61 @@
[
{
"id": "3f7e1c45-a2e9-4b08-a56d-e687ea79ba61",
"firstName": "สมชัย14",
"lastName": "แสงสุข",
"affiliation": "ลูกจ้าง",
"rank": "นาง",
"idcard": "134044411441178",
"phone": "0325647845",
"status": "โสด",
"typeAffiliation": "ลูกจ้าง",
"typeRanks": "ลูกจ้าง"
},
{
"id": "8e81c39a-d50c-42f5-85c0-f9f773c2a4aa",
"firstName": "สมชัย",
"lastName": "แสงสุข",
"affiliation": "บช.ตซด.",
"rank": "ส.ต.อ.",
"idcard": "134044411441178",
"phone": "0325647845",
"typeAffiliation": "บช.ตซด.",
"typeRanks": "ประทวน"
},
{
"id": "ebd367bf-396f-4bae-8130-1ce3fa130d38",
"firstName": "สมชัย",
"lastName": "แสงสุข",
"affiliation": "ลูกจ้าง",
"rank": "นาง",
"idcard": "134044411441178",
"phone": "0325647845",
"status": "โสด",
"typeAffiliation": "ลูกจ้าง",
"typeRanks": "ลูกจ้าง"
},
{
"id": "fc3710ca-c3af-4781-9c8f-4aa6657ddff4",
"firstName": "สมาน788",
"lastName": "แสงสุข7",
"affiliation": "ลูกจ้าง",
"rank": "นาง",
"idcard": "13404441144",
"phone": "0325647847",
"status": "โสด",
"typeAffiliation": "ลูกจ้าง",
"typeRanks": "ลูกจ้าง"
},
{
"id": "967bf9a7-047e-4951-ba2a-190f42045715",
"firstName": "สมชัย",
"lastName": "แสงสุข",
"affiliation": "ฝสสน.1",
"rank": "ส.ต.ท.",
"idcard": "134044411441178",
"phone": "0325647845",
"status": "โสด",
"typeAffiliation": "บก.สนน.",
"typeRanks": "ประทวน"
}
]

View File

@ -10,5 +10,6 @@ module.exports = {
],
rules: {
"vue/multi-word-component-names": "off",
"vue/no-multiple-template-root": 0
},
};

View File

@ -8,11 +8,13 @@
"preview": "vite preview --port 4173",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore"
},
"dependencies": {
"@popperjs/core": "2.11.5",
"@trevoreyre/autocomplete-vue": "^2.4.1",
"axios": "^1.5.1",
"bootstrap": "5.1.3",
"fs-web": "^1.0.1",
"pinia": "2.0.14",
"prismjs": "1.28.0",
"typed.js": "2.0.12",

View File

@ -504,7 +504,7 @@ export default {
</template>
<style>
.bg-green {
border: 2px solid #86d388 !important;
border: 2px solid #4CBB17 !important;
color: #000;
}
.bg-red {

View File

@ -4,53 +4,7 @@ import MaterialButton from "@/components/MaterialButton.vue";
import Breadcrumbs from "@/examples/Breadcrumbs.vue";
import vueMkHeader from "@/assets/img/bg.jpg";
import userData from "@/assets/dataJson/users.json";
const listRoom = [
{ title: "ตึก 1" },
{ title: "ตึก 2" },
{ title: "ตึก 3" },
{ title: "ตึก 4" },
{ title: "ตึก 5" },
{ title: "ตึก 6" },
{ title: "ตึก 7" },
];
const NoRoom = [
{ title: "ชั้น 1" },
{ title: "ชั้น 2" },
{ title: "ชั้น 3" },
{ title: "ชั้น 4" },
{ title: "ชั้น 5" },
{ title: "ชั้น 6" },
{ title: "ชั้น 7" },
];
const userlist = [
{
dataIndex: "1",
firstName: "สมชาย",
lastName: "แสงทอง",
Affiliation: "ฝอ.2", //
rank: "ส.ต.ต.", //
old: "32",
status: "สมรส",
birthday: "04/03/2534",
idcard: "134044411441122",
phone: "0325647846",
},
{
dataIndex: "2",
firstName: "สมชัย",
lastName: "แสงสุข",
Affiliation: "ฝอ.2", //
rank: "ส.ต.ต.", //
old: "32",
status: "โสด",
birthday: "14/07/2534",
idcard: "134044411441178",
phone: "0325647845",
},
];
import axios from "axios";
export default {
components: {
@ -60,9 +14,6 @@ export default {
},
setup() {
return {
listRoom,
NoRoom,
userlist,
vueMkHeader,
userData,
};
@ -77,20 +28,29 @@ export default {
{ label: "ธนาพร", value: "ธนาพร" },
{ label: "มนตรี", value: "มนตรี" },
],
selectedColor: "",
selectedUser: "",
firstName: "",
lastName: "",
Affiliation: "", //
rank: "", //
idcard: "",
phone: "",
booknumber: "",
bookNumber: "",
queueList : [],
userList : [],
userByid: {}
};
},
created() {
// console.log(this.masterData);
this.getAllqueue();
this.getAllusers()
},
watch: {
selectedColor: function (newValue) {
selectedUser: function (newValue) {
// this.updateColor(newValue)
console.log(newValue);
console.log(newValue.value);
this.getAllusersByid(newValue.value)
},
},
methods: {
@ -99,19 +59,90 @@ export default {
// this.selected = event;
},
getAllqueue() {
try {
axios
.get("http://localhost:3001/queue")
.then((res) => {
this.queueList = res.data;
console.log(this.queueList);
})
.catch((err) => {
console.log(err.response);
});
} catch (error) {
console.error(error);
}
},
getAllusersByid(id) {
try {
axios
.get(`http://localhost:3001/users/${id}`)
.then((res) => {
let data =res.data
this.userByid = data
// console.log(this.userByid)
})
.catch((err) => {
console.log(err.response);
});
} catch (error) {
console.error(error);
}
},
getAllusers() {
try {
axios
.get("http://localhost:3001/users")
.then((res) => {
this.userList = res.data.map(ele =>{
return {
label : ele.rank + " "+ ele.firstName + " " + ele.lastName,
value : ele.id,
}
})
})
.catch((err) => {
console.log(err.response);
});
} catch (error) {
console.error(error);
}
},
submitForm() {
// firstName: this.firstName,
// lastName: this.lastName,
// Affiliation: this.Affiliation,
// rank: this.rank,
// idcard: this.idcard,
// phone: this.phone,
let body = {
firstName: this.firstName,
lastName: this.lastName,
Affiliation: this.Affiliation,
rank: this.rank,
idcard: this.idcard,
phone: this.phone,
...this.userByid,
bookNumber: this.bookNumber
};
delete body.id
console.log(body);
axios
.post(`http://localhost:3001/queue`, body, {
headers: {
// remove headers
"Access-Control-Allow-Origin": "*",
"Content-Type": "application/json",
},
})
.then((res) => {
this.getAllqueue();
})
.catch((err) => {
console.log(err.response);
});
// let b = []
// b.push(body)
this.userlist.push(body);
console.log(this.userlist);
// this.userlist.push(body);
// console.log(this.userlist);
},
},
};
@ -195,16 +226,18 @@ export default {
<th scope="col">สถานภาพ</th>
<th scope="col">เลขบตรประชาชน</th>
<th scope="col">เบอรดต</th>
<th scope="col">เลขลงรบหนงส</th>
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in userlist" :key="index">
<tr v-for="(item, index) in queueList" :key="index">
<th scope="row">{{ index + 1 }}</th>
<td>{{ item.rank }} {{ item.firstName }} {{ item.lastName }}</td>
<td>{{ item.Affiliation }}</td>
<td>{{ item.status }}</td>
<td>{{ item.idcard }}</td>
<td>{{ item.phone }}</td>
<td>{{ item?.rank }} {{ item?.firstName }} {{ item?.lastName }}</td>
<td>{{ item?.affiliation }}</td>
<td>{{ item?.status }}</td>
<td>{{ item?.idcard }}</td>
<td>{{ item?.phone }}</td>
<td>{{ item?.bookNumber }}</td>
</tr>
</tbody>
</table>
@ -236,19 +269,31 @@ export default {
<div>
<div class="mb-3">
<label>อผเช</label>
<v-select :options="userData?.users" v-model="selectedColor"></v-select>
<v-select :options="userList" v-model="selectedUser"></v-select>
</div>
<div class="mb-3">
<label style="margin-left: -5px">กรอกเลขลงรบหนงส</label>
<textarea
:value="booknumber"
@input="(event) => (booknumber = event.target.value)"
:value="bookNumber"
@input="(event) => (bookNumber = event.target.value)"
class="form-control"
id="exampleFormControlTextarea1"
rows="3"
placeholder="ตัวอย่าง : 11244"
></textarea>
</div>
<div class="row g-0" v-if="selectedUser!== ''">
<div class="col-md-12">
<div class="row" >
<h5 class="card-title ">รายละเอยดผเช</h5>
<p class="card-text pt-1">-สก : {{ userByid?.rank }} {{ userByid?.firstName }} {{ userByid?.lastName }}</p>
<p class="card-text">งก : {{ userByid?.affiliation }}</p>
<p class="card-text">เลขบตรประชาชน : {{ userByid?.idcard }}</p>
<p class="card-text">สถานภาพ : {{ userByid?.status }}</p>
<p class="card-text">เบอรโทร : {{ userByid?.phone }}</p>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
@ -260,6 +305,7 @@ export default {
color="success"
@click="submitForm"
html-type="submit"
data-bs-dismiss="modal"
>นท</MaterialButton
>
</div>
@ -270,7 +316,7 @@ export default {
</template>
<style>
.bg-green {
border: 2px solid #86d388 !important;
border: 2px solid #4CBB17 !important;
color: #000;
}
.bg-red {

View File

@ -762,7 +762,7 @@ export default {
</template>
<style>
.bg-green {
border: 2px solid #86d388 !important;
border: 2px solid #4CBB17 !important;
color: #000;
}
.bg-red {

View File

@ -484,7 +484,7 @@ export default {
</template>
<style>
.bg-green {
border: 2px solid #86d388 !important;
border: 2px solid #4CBB17 !important;
color: #000;
}
.bg-red {

View File

@ -487,7 +487,7 @@ export default {
font-size: 30px;
}
.bg-green {
background-color: #86d388 !important;
background-color: #4cbb17 !important;
color: #fff;
}
.bg-red {
@ -507,7 +507,7 @@ export default {
color: #fff !important;
}
.bgg-green {
background-color: #86d388 !important;
background-color: #4cbb17 !important;
color: #fff !important;
}
.bgg-red {

View File

@ -1003,7 +1003,7 @@ export default {
</template>
<style>
.bg-green {
border: 2px solid #86d388 !important;
border: 2px solid #4CBB17 !important;
color: #000;
}
.bg-red {

View File

@ -316,7 +316,7 @@ export default {
</template>
<style>
.bg-green {
border: 2px solid #86d388 !important;
border: 2px solid #4CBB17 !important;
color: #000;
}
.bg-red {

View File

@ -4,53 +4,7 @@ import MaterialButton from "@/components/MaterialButton.vue";
import Breadcrumbs from "@/examples/Breadcrumbs.vue";
import vueMkHeader from "@/assets/img/bg.jpg";
import masterData from "@/assets/dataJson/masterData.json";
const listRoom = [
{ title: "ตึก 1" },
{ title: "ตึก 2" },
{ title: "ตึก 3" },
{ title: "ตึก 4" },
{ title: "ตึก 5" },
{ title: "ตึก 6" },
{ title: "ตึก 7" },
];
const NoRoom = [
{ title: "ชั้น 1" },
{ title: "ชั้น 2" },
{ title: "ชั้น 3" },
{ title: "ชั้น 4" },
{ title: "ชั้น 5" },
{ title: "ชั้น 6" },
{ title: "ชั้น 7" },
];
const userlist = [
{
dataIndex: "1",
firstName: "สมชาย",
lastName: "แสงทอง",
Affiliation: "ฝอ.1", //
rank: "ส.ต.ต.", //
old: "32",
status: "สมรส",
birthday: "04/03/2534",
idcard: "134044411441122",
phone: "0325647846",
},
{
dataIndex: "2",
firstName: "สมชัย",
lastName: "แสงสุข",
Affiliation: "ฝอ.2", //
rank: "ส.ต.ต.", //
old: "32",
status: "โสด",
birthday: "14/07/2534",
idcard: "134044411441178",
phone: "0325647845",
},
];
import axios from "axios";
export default {
components: {
@ -60,9 +14,6 @@ export default {
},
setup() {
return {
listRoom,
NoRoom,
userlist,
vueMkHeader,
masterData,
};
@ -70,14 +21,6 @@ export default {
data() {
return {
value: { name: "Vue.js", language: "JavaScript" },
options: [
{ label: "Vue.js", value: "JavaScript" },
{ label: "Rails", value: "Ruby" },
{ label: "Sinatra", value: "Ruby" },
{ label: "Laravel", value: "PHP" },
{ label: "Phoenix", value: "Elixir" },
],
DataObtion: [
{ label: "โสด", value: "โสด" },
{ label: "สมรส", value: "สมรส" },
@ -95,10 +38,15 @@ export default {
birthday: "14/07/2534",
typeAffiliation: "",
typeRanks: "",
dataUser: [],
modalShow: false,
id: "",
searchName: "",
};
},
created() {
console.log(this.masterData);
// console.log(this.masterData);
this.getAlluser();
},
watch: {
selectedColor: function (newValue) {
@ -120,25 +68,122 @@ export default {
// }
},
},
methods: {
changedLabel(event) {
console.log(event);
// this.selected = event;
filteredData() {
this.dataUser.filter((entry) =>
this.dataUser.length
? Object.keys(this.dataUser[0]).some((key) =>
("" + entry[key]).toLowerCase().includes(this.searchName.toLowerCase())
)
: true
);
},
submitForm() {
async editUser(id) {
await axios
.get(`http://localhost:3001/users/${id}`)
.then((res) => {
let data = res.data;
this.id = id;
(this.firstName = data.firstName),
(this.lastName = data.lastName),
(this.selectedAffiliation = data.affiliation),
(this.selectedRanks = data.rank),
(this.idcard = data.idcard),
(this.phone = data.phone),
(this.selectedDataObtion = data.status);
(this.typeAffiliation = data.typeAffiliation),
(this.typeRanks = data.typeRanks);
this.modalShow = true;
})
.catch((err) => {
console.log(err.response);
});
},
async editForm() {
let typeA;
this.typeAffiliation.label == "ลูกจ้าง"
? (typeA = "ลูกจ้าง")
: this.typeAffiliation.label == "บช.ตซด."
? (typeA = "บช.ตซด.")
: (typeA = this.selectedAffiliation.label);
let body = {
firstName: this.firstName,
lastName: this.lastName,
Affiliation: this.Affiliation,
rank: this.rank,
affiliation: typeA,
rank: this.selectedRanks.value,
idcard: this.idcard,
phone: this.phone,
status: this.selectedDataObtion.value || "โสด",
typeAffiliation: this.typeAffiliation.value,
typeRanks: this.typeRanks.value,
};
// let b = []
// b.push(body)
this.userlist.push(body);
console.log(this.userlist);
axios
.put(`http://localhost:3001/users/${this.id}`, body, {
headers: {
// remove headers
"Access-Control-Allow-Origin": "*",
"Content-Type": "application/json",
},
})
.then((res) => {
this.getAlluser();
})
.catch((err) => {
console.log(err.response);
});
},
async submitForm() {
let typeA;
this.typeAffiliation.label == "ลูกจ้าง"
? (typeA = "ลูกจ้าง")
: this.typeAffiliation.label == "บช.ตซด."
? (typeA = "บช.ตซด.")
: (typeA = this.selectedAffiliation.label);
let body = {
firstName: this.firstName,
lastName: this.lastName,
affiliation: typeA,
rank: this.selectedRanks.value,
idcard: this.idcard,
phone: this.phone,
status: this.selectedDataObtion.value || "โสด",
typeAffiliation: this.typeAffiliation.value,
typeRanks: this.typeRanks.value,
};
axios
.post(`http://localhost:3001/users`, body, {
headers: {
// remove headers
"Access-Control-Allow-Origin": "*",
"Content-Type": "application/json",
},
})
.then((res) => {
this.getAlluser();
})
.catch((err) => {
console.log(err.response);
});
},
getAlluser() {
try {
axios
.get("http://localhost:3001/users")
.then((res) => {
this.dataUser = res.data;
})
.catch((err) => {
console.log(err.response);
});
} catch (error) {
console.error(error);
}
},
},
};
@ -201,6 +246,9 @@ export default {
icon="search"
type="text"
placeholder="Search"
:value="searchName"
@change="filteredData()"
@input="(event) => (searchName = event.target.value)"
/>
<MaterialButton
style="margin-left: 20px"
@ -252,16 +300,20 @@ export default {
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in userlist" :key="index">
<tr v-for="(item, index) in dataUser" :key="index">
<th scope="row">{{ index + 1 }}</th>
<td>{{ item.rank }} {{ item.firstName }} {{ item.lastName }}</td>
<td>{{ item.Affiliation }}</td>
<td>{{ item.status }}</td>
<td>{{ item?.rank }} {{ item?.firstName }} {{ item?.lastName }}</td>
<td>{{ item?.affiliation }}</td>
<td>{{ item?.status }}</td>
<!-- <td>{{ item.idcard }}</td> -->
<td>{{ item.phone }}</td>
<td>{{ item?.phone }}</td>
<td>
<a data-bs-toggle="modal" data-bs-target="#EdituserBackdrop"
<!-- data-bs-toggle="modal" data-bs-target="#EdituserBackdrop" -->
<a
@click="editUser(item?.id)"
data-bs-toggle="modal"
data-bs-target="#EdituserBackdrop"
><i
class="material-icons me-2"
style="cursor: pointer"
@ -400,6 +452,7 @@ export default {
color="success"
@click="submitForm"
html-type="submit"
data-bs-dismiss="modal"
>นท</MaterialButton
>
</div>
@ -452,10 +505,10 @@ export default {
></v-select>
</div>
<div class="mb-1">
<label>ยศ</label>
<label>ลำดยศ</label>
<v-select :options="masterData?.typeranks" v-model="typeRanks"></v-select>
</div>
<div class="mb-3" v-if="typeRanks.label == 'ทั่วไป'">
<div class="mb-3" v-if="typeRanks.label == 'ลูกจ้าง'">
<label> {{ typeRanks.label }}</label>
<v-select :options="masterData?.ranks" v-model="selectedRanks"></v-select>
</div>
@ -527,8 +580,9 @@ export default {
<MaterialButton
variant="gradient"
color="success"
@click="submitForm"
@click="editForm"
html-type="submit"
data-bs-dismiss="modal"
>นท</MaterialButton
>
</div>
@ -539,7 +593,7 @@ export default {
</template>
<style>
.bg-green {
border: 2px solid #86d388 !important;
border: 2px solid #4cbb17 !important;
color: #000;
}
.bg-red {

View File

View File

@ -787,7 +787,7 @@ export default {
</template>
<style>
.bg-green {
border: 2px solid #86d388 !important;
border: 2px solid #4CBB17 !important;
color: #000;
}
.bg-red {