From 828ac10663d5fa8c3159926dc9193f97c266950e Mon Sep 17 00:00:00 2001 From: Avris Date: Sat, 28 Aug 2021 16:34:30 +0200 Subject: [PATCH] [api] GET /api/versions --- server/index.js | 2 ++ server/routes/home.js | 10 ++++++++++ 2 files changed, 12 insertions(+) create mode 100644 server/routes/home.js 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;