Skip to content

Commit b49a0d0

Browse files
committed
Edit api result datas
1 parent 6d8948b commit b49a0d0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jsonapitestserver",
3-
"version": "0.0.0",
3+
"version": "1.0.0",
44
"private": true,
55
"scripts": {
66
"start": "node ./bin/www"

routes/jsonFile.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ router.delete('/', function(req, res, next) {
2929

3030
try {
3131
fs.unlinkSync(filepath);
32-
resultData = 'OK';
32+
resultData = 'Success Delete';
3333
} catch(e) {
3434
// console.log(e);
3535
resultData = 'Fail Delete';
@@ -47,10 +47,10 @@ router.post('/', function(req, res, next) {
4747
try {
4848
mkdirp(filepath);
4949
fs.writeFileSync(filepath, JSON.stringify(json), 'utf8');
50-
resultData = 'OK';
50+
resultData = json;
5151
} catch(e) {
5252
// console.log(e);
53-
resultData = 'Fail Add';
53+
resultData = 'Fail Post';
5454
res.status(500);
5555
}
5656
res.json(resultData);

0 commit comments

Comments
 (0)