프로젝트

일반

사용자정보

통계
| 개정판:

root / HServer / 00.Server / routers / agent.js @ 37

이력 | 보기 | 이력해설 | 다운로드 (1.06 KB)

1 37 HKM
/*
2
    Agent 의 정보를 관리
3
    POST    생성
4
    GET     조회
5
    PUT     수정
6
    DELETE  삭제
7
*/
8
var express = require('express');
9
var dbCenter = require('./DB/dbCenter');
10
11
12
var agentSchema = mongose.Schma({
13
    _ip: String,
14
    _mac: String,
15
    _Contents: String,
16
    _FTPAddress: String,
17
    _Version: String
18
});
19
20
var agentModel = mongoose.model('agents', agentSchema);
21
22
23
24
25
var router = express.Router();
26
27
// 생성
28
router.post('/',function(req, res){
29
    console.log('[agent] route');
30
31
32
});
33
34
// 전체 조회
35
router.get('/', function(req, res){
36
    console.log('[agent] 전체조회 호출');
37
38
    dbCenter.data_All(function(err, users){
39
40
    });
41
42
43
44
});
45
46
47
48
49
// 특정 정보로 조회
50
router.get('/:mac', function(req, res){
51
    console.log('[agent] get/:mac');
52
});
53
54
// 수정
55
router.put('/:mac', function(req, res){
56
    console.log('[agent] put/:mac');
57
});
58
59
// 삭제
60
router.delete('/:mac', function(req, res){
61
    console.log('[agent delete/:mac');
62
});
63
64
65
exports.default = router;