Options
All
  • Public
  • Public/Protected
  • All
Menu

Vega Editor API documentation

Index

Variables

Const GitHubStrategy

GitHubStrategy: any = passportGitHub.Strategy

OAuth strategy to authenticate with GitHub. Reference: http://www.passportjs.org/packages/passport-github2/

Const authMain

authMain: "/auth/github" = "/auth/github"

Prefix for URLs for authentication with GitHub.

Const cookieExpiry

cookieExpiry: number = 90 * 24 * 60 * 60

Stores the expiry date of the cookie set.

Exported as cookieExpiry.

Const docsUrl

docsUrl: "https://vega.github.io/editor-backend" = "https://vega.github.io/editor-backend"

Const gistMain

gistMain: "/gists" = "/gists"

Const gistRawUrl

gistRawUrl: "https://gist.githubusercontent.com" = "https://gist.githubusercontent.com"

Let hostUrl

hostUrl: string = ""

Stores the domain name for callback url after successful authentication.

Exported as hostUrl for callback after GitHub sends code.

Const nodeEnv

nodeEnv: string = process.env.NODE_ENV

Stores the type of environment of project. It is either development or production.

Exported as nodeEnv to differentiate behaviour of app on development and production server.

Const paginationSize

paginationSize: 8 = 8

Stores the pagination size of displaying gists.

Exported as paginationSize.

Const sessionSecret

sessionSecret: string = process.env.SESSION_SECRET

Secret used to sign the session ID cookie.

Exported as sessionSecret to configure cookie creation.

Object literals

Const authUrl

authUrl: object

Stores the different types of URLs required for authentication.

Exported as authUrl for configuring endpoints of authentication.

callback

callback: string = `${authMain}/callback`

The URL redirected to after successful authentication with GitHub.

isAuthenticated

isAuthenticated: string = `${authMain}/check`

Endpoint to verify if the user is authenticated.

logout

logout: string = `${authMain}/logout`

Endpoint for signing out of the back-end service.

main

main: string = authMain

Endpoint for signing in with GitHub.

Const gistUrl

gistUrl: object

allGists

allGists: string = `${gistMain}/user`

createGist

createGist: string = `${gistMain}/create`

main

main: string = gistMain

updateGist

updateGist: string = `${gistMain}/update`

Const githubOauth

githubOauth: object

Stores the client ID and client secret of GitHub OAuth application created here.

Exported as githubOauth for configuring GitHub passport strategy.

GITHUB_CLIENT_ID

GITHUB_CLIENT_ID: string = process.env.GITHUB_CLIENT_ID

Client ID of OAuth application.

GITHUB_CLIENT_SECRET

GITHUB_CLIENT_SECRET: string = process.env.GITHUB_CLIENT_SECRET

Client secret of OAuth application.

Const redirectUrl

redirectUrl: object

Stores redirection URL for successful and failed authentication.

Exported as redirectUrl for redirections.

failure

failure: string = authUrl.isAuthenticated

The URL redirected to if the user is not logged in.

successful

successful: string = ""

The URL redirected by this back-end service to homepage.

Const redisConfiguration

redisConfiguration: object

Stores the configuration for redis store.

REDIS_HOST

REDIS_HOST: string = process.env.REDIS_HOST

Host name for redis store.

REDIS_PASSWORD

REDIS_PASSWORD: string = process.env.REDIS_PASSWORD

Host password for redis store.

REDIS_PORT

REDIS_PORT: number = +process.env.REDIS_PORT

Port number for redis store.

Generated using TypeDoc