diff --git a/index.js b/index.js index 3826513..3920065 100644 --- a/index.js +++ b/index.js @@ -2,16 +2,17 @@ * * 2020-05-15T20:28:14.357Z -PUT /changelog +curl -X PUT 'http://localhost:9200/changelog' -d ' { "mappings": { "properties": { "author": { "type": "keyword" }, "content": { "type": "text" }, - "created_at": { "type": "date","format": "basic_date_time" } + "created_at": { "type": "date","format": "date_optional_time" } } } -} +}' -H "Content-Type: application/json" + * */ @@ -24,7 +25,7 @@ const authorizationToken = process.env.AUTH_TOKEN || "hello"; const port = process.env.APP_PORT || 3000; function requireAuthentication( req, res, next ){ - const userAuth = req.get("authorizationToken") || req.query.authorizationToken; + const userAuth = req.get("AuthorizationToken") || req.query.authorizationToken; console.log( "userAuth : "+userAuth) if( userAuth && userAuth === authorizationToken ) next(); else res.end("Auth required");