diff --git a/middlewares/exportToOpml.js b/middlewares/export-to-opml.js similarity index 100% rename from middlewares/exportToOpml.js rename to middlewares/export-to-opml.js diff --git a/middlewares/getFileLink.js b/middlewares/get-file-link.js similarity index 100% rename from middlewares/getFileLink.js rename to middlewares/get-file-link.js diff --git a/middlewares/getUrlByTitle.js b/middlewares/get-url-by-title.js similarity index 100% rename from middlewares/getUrlByTitle.js rename to middlewares/get-url-by-title.js diff --git a/middlewares/getUrl.js b/middlewares/get-url.js similarity index 100% rename from middlewares/getUrl.js rename to middlewares/get-url.js diff --git a/middlewares/importFromOpml.js b/middlewares/import-from-opml.js similarity index 100% rename from middlewares/importFromOpml.js rename to middlewares/import-from-opml.js diff --git a/middlewares/index.js b/middlewares/index.js index 31846b46027..a7391a2087c 100644 --- a/middlewares/index.js +++ b/middlewares/index.js @@ -1,5 +1,5 @@ const fs = require('fs'); - +const camelcase = require('camelcase'); const middlewares = {}; const files = fs.readdirSync(__dirname); const jsFiles = files.filter((f) => { @@ -7,7 +7,7 @@ const jsFiles = files.filter((f) => { }); jsFiles.forEach((file) => { const fileName = file.substring(0, file.length - 3); - middlewares[fileName] = require(__dirname + '/' + file); + middlewares[camelcase(fileName)] = require(__dirname + '/' + file); }); module.exports = middlewares; diff --git a/middlewares/isAdmin.js b/middlewares/is-admin.js similarity index 100% rename from middlewares/isAdmin.js rename to middlewares/is-admin.js diff --git a/middlewares/onlyPrivateChat.js b/middlewares/only-private-chat.js similarity index 100% rename from middlewares/onlyPrivateChat.js rename to middlewares/only-private-chat.js diff --git a/middlewares/sendError.js b/middlewares/send-error.js similarity index 100% rename from middlewares/sendError.js rename to middlewares/send-error.js diff --git a/middlewares/subMultiUrl.js b/middlewares/sub-multi-url.js similarity index 100% rename from middlewares/subMultiUrl.js rename to middlewares/sub-multi-url.js diff --git a/middlewares/testUrl.js b/middlewares/test-url.js similarity index 100% rename from middlewares/testUrl.js rename to middlewares/test-url.js