diff --git a/server/index.js b/server/index.js index 770d11f8..392870b6 100644 --- a/server/index.js +++ b/server/index.js @@ -78,6 +78,8 @@ app.use(async function (req, res, next) { router.use(grant.express()(require('./social').config)); +app.use(require('./routes/home').default); + app.use(require('./routes/banner').default); app.use(require('./routes/user').default); diff --git a/server/routes/home.js b/server/routes/home.js new file mode 100644 index 00000000..925093c2 --- /dev/null +++ b/server/routes/home.js @@ -0,0 +1,10 @@ +import { Router } from 'express'; +import {buildLocaleList, handleErrorAsync} from "../../src/helpers"; + +const router = Router(); + +router.get('/versions', handleErrorAsync(async (req, res) => { + return res.json(buildLocaleList(global.config.locale)); +})); + +export default router;