mirror of
https://github.com/Redume/Kekkai.git
synced 2025-02-23 20:51:25 +03:00
Сделан роут с конфигурацией инстанса
This commit is contained in:
parent
423b4a4ff6
commit
e665903c5a
2 changed files with 16 additions and 0 deletions
|
@ -21,8 +21,10 @@ const fastify = require('fastify')({
|
||||||
});
|
});
|
||||||
|
|
||||||
const getRateRoute = require('./routes/getRate.js');
|
const getRateRoute = require('./routes/getRate.js');
|
||||||
|
const configurationRoutes = require('./routes/configuration.js');
|
||||||
|
|
||||||
fastify.register(getRateRoute);
|
fastify.register(getRateRoute);
|
||||||
|
fastify.register(configurationRoutes);
|
||||||
|
|
||||||
fastify.listen(
|
fastify.listen(
|
||||||
{
|
{
|
||||||
|
|
14
server/routes/configuration.js
Normal file
14
server/routes/configuration.js
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
const config = require("../../shared/config/src/main.js")();
|
||||||
|
|
||||||
|
module.exports = async function configurationRoutes(fastify) {
|
||||||
|
fastify.get('/api/configurations/json', async function (req, res) {
|
||||||
|
delete config['database']
|
||||||
|
delete config['currency']['coinapiKeys']
|
||||||
|
delete config['server']['ssl']['private_key']
|
||||||
|
delete config['server']['ssl']['cert']
|
||||||
|
|
||||||
|
return res.status(200).send({
|
||||||
|
config
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue