This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Bearer } from 'permit' | |
import express from 'express' | |
const permit = new Bearer({ | |
basic: 'username', // Also allow a Basic Auth username as a token. | |
query: 'access_token', // Also allow an `?access_token=` query parameter. | |
}) | |
function authenticate(req, res, next) { | |
// Try to find the bearer token in the request. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const divStyle = { | |
color: 'blue', | |
backgroundImage: 'url(' + imgUrl + ')', | |
}; | |
function HelloWorldComponent() { | |
return <div style={divStyle}>Hello World!</div>; |