Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
 
 

README.md

Outline

Web Application

Local development

Use sg CLI tool to configure and start local development server. For more information checkout sg README.

Configuration

Environment variables important for the web server:

  1. WEBPACK_SERVE_INDEX should be set to true to enable HTMLWebpackPlugin.
  2. SOURCEGRAPH_API_URL is used as a proxied API url. By default it points to the https://k8s.sgdev.org.

It's possible to overwrite these variables by creating sg.config.overwrite.yaml in the root folder and adjusting the env section of the relevant command.

Development server

sg run web-standalone

For enterprise version:

sg run enterprise-web-standalone

Production server

sg run web-standalone-prod

For enterprise version:

sg run enterprise-web-standalone-prod

Web app should be available at http://${SOURCEGRAPH_HTTPS_DOMAIN}:${SOURCEGRAPH_HTTPS_PORT}. Build artifacts will be served from <rootRepoPath>/ui/assets.

API proxy

In both environments, server proxies API requests to SOURCEGRAPH_API_URL provided as the .env variable. To avoid the CSRF token is invalid error CSRF token is retrieved from the SOURCEGRAPH_API_URL before the server starts. Then this value is used for every subsequent request to the API.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.