sourcegraph/client/web
Valery Bugakov 24e2b4e926
web: update branding colors and Sourcegraph logo images (#23751)
- update branding colors and Sourcegraph logo images
- add global assets folder to Storybook commands
2021-08-13 18:58:09 +08:00
..
bookmarklet web: flatten frontend packages inside of the client folder (#19378) 2021-03-26 15:35:26 +08:00
dev Attempt #3: upgrade to Webpack v5 (#22580) 2021-07-19 16:08:50 +08:00
src web: update branding colors and Sourcegraph logo images (#23751) 2021-08-13 18:58:09 +08:00
.eslintignore web: flatten frontend packages inside of the client folder (#19378) 2021-03-26 15:35:26 +08:00
.eslintrc.js Move all client code into client/ folder (#14480) 2020-10-07 22:23:53 +02:00
.stylelintrc.json Move all client code into client/ folder (#14480) 2020-10-07 22:23:53 +02:00
babel.config.js Move all client code into client/ folder (#14480) 2020-10-07 22:23:53 +02:00
gulpfile.js Attempt #3: upgrade to Webpack v5 (#22580) 2021-07-19 16:08:50 +08:00
jest.config.js Mock eventLogger globally (#22313) 2021-06-24 13:26:23 +01:00
package.json web: add Storybook workspace level commands (#22311) 2021-06-23 22:23:19 +08:00
README.md Fix link to sg CLI README.md (#22888) 2021-07-19 12:22:17 -07:00
tsconfig.json Fix: Colors Storybook unable to retrieve CSS variables (#22113) 2021-06-16 15:41:20 +01:00
webpack.config.js web: load runtime bundle in locally executed integration tests (#22969) 2021-07-19 22:26:27 +08:00

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.