Refactor
This commit is contained in:
@@ -49,13 +49,6 @@ endpoints.forEach(endpoint =>
|
||||
app.post('/signup', require('./private/signup').default);
|
||||
app.post('/signin', require('./private/signin').default);
|
||||
|
||||
app.use((req, res, next) => {
|
||||
// req.headers['cookie'] は常に string ですが、型定義の都合上
|
||||
// string | string[] になっているので string を明示しています
|
||||
res.locals.user = ((req.headers['cookie'] as string || '').match(/i=(!\w+)/) || [null, null])[1];
|
||||
next();
|
||||
});
|
||||
|
||||
require('./service/github')(app);
|
||||
require('./service/twitter')(app);
|
||||
|
||||
|
Reference in New Issue
Block a user