{"repo":"express","file":".editorconfig","line":2,"symbol":"root","kind":"field","lang":"editorconfig","code":"root = true"} {"repo":"express","file":".editorconfig","line":4,"symbol":"[*]\n","kind":"section","lang":"editorconfig","code":"[*]\ncharset = utf-8\ninsert_final_newline = true\ntrim_trailing_whitespace = true"} {"repo":"express","file":".editorconfig","line":5,"symbol":"charset","kind":"field","lang":"editorconfig","code":"charset = utf-8"} {"repo":"express","file":".editorconfig","line":6,"symbol":"insert_final_newline","kind":"field","lang":"editorconfig","code":"insert_final_newline = true"} {"repo":"express","file":".editorconfig","line":7,"symbol":"trim_trailing_whitespace","kind":"field","lang":"editorconfig","code":"trim_trailing_whitespace = true"} {"repo":"express","file":".editorconfig","line":9,"symbol":"[{*.js,*.json,*.yml}]\n","kind":"section","lang":"editorconfig","code":"[{*.js,*.json,*.yml}]\nindent_size = 2\nindent_style = space"} {"repo":"express","file":".editorconfig","line":10,"symbol":"indent_size","kind":"field","lang":"editorconfig","code":"indent_size = 2"} {"repo":"express","file":".editorconfig","line":11,"symbol":"indent_style","kind":"field","lang":"editorconfig","code":"indent_style = space"} {"repo":"express","file":"examples/auth/index.js","line":60,"symbol":"authenticate","kind":"function","lang":"javascript","code":"function authenticate(name, pass, fn) {\n if (!module.parent) console.log('authenticating %s:%s', name, pass);\n var user = users[name];\n // query the db for the given username\n if (!user) return fn(null, null)\n // apply the same algorithm to the POSTed password, applying\n // the hash against the pass / salt, if there is a match we\n // found the user\n hash({ password: pass, salt: user.salt }, function (err, pass, salt, hash) {\n if (err) return fn(err);\n if (hash === user.hash) return fn(null, user)\n fn(null, null)\n });\n}"} {"repo":"express","file":"examples/auth/index.js","line":75,"symbol":"restrict","kind":"function","lang":"javascript","code":"function restrict(req, res, next) {\n if (req.session.user) {\n next();\n } else {\n req.session.error = 'Access denied!';\n res.redirect('/login');\n }\n}"} {"repo":"express","file":"examples/content-negotiation/index.js","line":33,"symbol":"format","kind":"function","lang":"javascript","code":"function format(path) {\n var obj = require(path);\n return function(req, res){\n res.format(obj);\n };\n}"} {"repo":"express","file":"examples/error/index.js","line":20,"symbol":"error","kind":"function","lang":"javascript","code":"function error(err, req, res, next) {\n // log it\n if (!test) console.error(err.stack);\n\n // respond with 500 \"Internal Server Error\".\n res.status(500);\n res.send('Internal Server Error');\n}"} {"repo":"express","file":"examples/online/index.js","line":40,"symbol":"list","kind":"function","lang":"javascript","code":"function list(ids) {\n return '