feat: first commit
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import cuid from "cuid";
|
||||
// import getDb from "../dbServer.mjs";
|
||||
import _ from "lodash";
|
||||
|
||||
import { getDb } from "funjia-server/lib/funjia-server.mjs";
|
||||
const getRouterSet= (router) => {
|
||||
router.get('/api/test', async (ctx) => {
|
||||
// 设置头类型, 如果不设置,会直接下载该页面
|
||||
ctx.type = 'application/json';
|
||||
const db = await getDb();
|
||||
const data = db.data.test;
|
||||
|
||||
ctx.body = {
|
||||
code:0,
|
||||
data
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
export default getRouterSet;
|
||||
Reference in New Issue
Block a user