Skip to content

Instantly share code, notes, and snippets.

@amazingandyyy
Last active December 7, 2016 01:24
Show Gist options
  • Save amazingandyyy/64d78f28a7ae4f48ef362891afd7a4f8 to your computer and use it in GitHub Desktop.
Save amazingandyyy/64d78f28a7ae4f48ef362891afd7a4f8 to your computer and use it in GitHub Desktop.
Advance Topic About Server Credential

Header

Discussion

var body = "hello world";
response.setHeader("Content-Length", body.length);
response.setHeader("Content-Type", "text/plain");
response.setHeader("Set-Cookie", "type=ninja");
response.status(200);
var body = "hello world";
response.writeHead(200, {
    "Content-Length": body.length,
    "Content-Type": "text/plain",
    "Set-Cookie": "type=ninja"
});

req.params and req.query

Discussion

JWT and Bcrypt

use JWT to generate and verify Javascript Web Token use Bcrypt to crpt password and compare password

Create Express Middleware

check express official Docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment