Skip to content

🚸 A super simple zeit/micro api authorization function.

License

Notifications You must be signed in to change notification settings

XLNT/micro-api-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚸 micro-api-auth

A super simple way of adding api key authorization to your zeit/micro microservice.

import withApiAuth from '@xlnt/micro-api-auth'

export default withApiAuth()(myMicroFunction)

withApiAuth also allows for some configuration like

getValidApiKeys: () => string[]
// pulls from process.env.API_KEYS (json encoded) by default

getApiKey: (req: IncomingMessage) => string
// pulls from req.headers['Authorization'] in the `Bearer :token` format by default

that's it.

About

🚸 A super simple zeit/micro api authorization function.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published