Skip to content

Commit

Permalink
filename use dash separated style
Browse files Browse the repository at this point in the history
  • Loading branch information
fengkx committed Mar 10, 2019
1 parent 7a8e300 commit d751b4e
Show file tree
Hide file tree
Showing 11 changed files with 2 additions and 2 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions middlewares/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
const fs = require('fs');

const camelcase = require('camelcase');
const middlewares = {};
const files = fs.readdirSync(__dirname);
const jsFiles = files.filter((f) => {
return f.endsWith('.js') && !f.startsWith('index');
});
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;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit d751b4e

Please sign in to comment.