-
Notifications
You must be signed in to change notification settings - Fork 5
/
app.js
30 lines (21 loc) · 805 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
var express = require('express')
var bodyParser = require('body-parser')
var app = express()
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({extended: true}))
app.use(express.static(__dirname + "/public"))
app.get("*", function (req, res) {
res.sendFile(__dirname + "/public/index.html")
})
var dbCtrl = require("./controller/database")
var tableCtrl = require("./controller/table")
var columnCtrl = require("./controller/column")
app.post("/database/list", dbCtrl.list)
app.post("/database/drop", dbCtrl.drop)
app.post("/table/list", tableCtrl.list)
app.post("/table/column/list", tableCtrl.columnlist)
app.post("/table/rows", tableCtrl.rows)
app.post("/table/drop", tableCtrl.drop)
app.post("/table/empty", tableCtrl.empty)
app.post("/column/drop", columnCtrl.drop)
app.listen(2222)