summaryrefslogtreecommitdiff
path: root/src/server/api/index.ts
diff options
context:
space:
mode:
authorAya Morisawa <AyaMorisawa4869@gmail.com>2018-12-11 20:36:55 +0900
committerGitHub <noreply@github.com>2018-12-11 20:36:55 +0900
commit125849673a1aba46021852ee473d00f4520d1bd6 (patch)
treee30d39490236df402b97a9963dafa44eaf549368 /src/server/api/index.ts
parentFix error (diff)
downloadsharkey-125849673a1aba46021852ee473d00f4520d1bd6.tar.gz
sharkey-125849673a1aba46021852ee473d00f4520d1bd6.tar.bz2
sharkey-125849673a1aba46021852ee473d00f4520d1bd6.zip
Use for-of instead of forEach (#3583)
Co-authored-by: syuilo <syuilotan@yahoo.co.jp> Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
Diffstat (limited to 'src/server/api/index.ts')
-rw-r--r--src/server/api/index.ts11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/server/api/index.ts b/src/server/api/index.ts
index ebb3d5a27f..04fc8759f9 100644
--- a/src/server/api/index.ts
+++ b/src/server/api/index.ts
@@ -41,10 +41,13 @@ const router = new Router();
/**
* Register endpoint handlers
*/
-endpoints.forEach(endpoint => endpoint.meta.requireFile
- ? router.post(`/${endpoint.name}`, upload.single('file'), handler.bind(null, endpoint))
- : router.post(`/${endpoint.name}`, handler.bind(null, endpoint))
-);
+for (const endpoint of endpoints) {
+ if (endpoint.meta.requireFile) {
+ router.post(`/${endpoint.name}`, upload.single('file'), handler.bind(null, endpoint));
+ } else {
+ router.post(`/${endpoint.name}`, handler.bind(null, endpoint));
+ }
+}
router.post('/signup', require('./private/signup').default);
router.post('/signin', require('./private/signin').default);