add web, api endpoint

This commit is contained in:
Jay 2018-08-11 23:28:00 +08:00
parent 1e834612cb
commit 89b24e0bf6
5 changed files with 23 additions and 1 deletions

View File

@ -12,7 +12,8 @@
{"file": "20180718-1.sql", "version": 10},
{"file": "20180719-1.sql", "version": 11},
{"file": "20180721-1.sql", "version": 12},
{"file": "20180807-1.sql", "version": 13}
{"file": "20180807-1.sql", "version": 13},
{"file": "20180811-1.sql", "version": 14}
],
"test": []
}

4
route/api/index.js Normal file
View File

@ -0,0 +1,4 @@
const Router = require('koa-router')
const r = new Router()
module.exports = r

View File

@ -99,6 +99,8 @@ r.get('/image/thumbnail/:name', async (c, n) => {
return n()
}, getImageToRes)
r.use('/web', require('./web').routes())
r.use('/api', require('./api').routes())
r.use('/line', require('./line').routes())
r.use('/google', require('./google').routes())
// r.use('/twitch', require('./twitch').routes())

4
route/web/index.js Normal file
View File

@ -0,0 +1,4 @@
const Router = require('koa-router')
const r = new Router()
module.exports = r

11
schema/20180811-1.sql Normal file
View File

@ -0,0 +1,11 @@
CREATE TABLE public.donate_progres
(
twitch varchar(100) PRIMARY KEY NOT NULL,
start_date timestamp with time zone,
end_date timestamp with time zone,
target_amount int DEFAULT 0 NOT NULL,
title varchar(200) DEFAULT '' NOT NULL,
ctime timestamp with time zone DEFAULT current_timestamp NOT NULL,
mtime timestamp with time zone DEFAULT current_timestamp NOT NULL,
CONSTRAINT donate_progres_twitch_channel_id_fk FOREIGN KEY (twitch) REFERENCES public.twitch_channel (id) ON DELETE CASCADE
);