-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
96 changed files
with
21,323 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
web/versioned_docs/version-0.14.0/_TypescriptServerNote.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
:::caution LSP Problems | ||
|
||
If you are using TypeScript, your editor may sometimes report type and import errors even while `wasp start` is running. | ||
|
||
This happens when the TypeScript Language Server gets out of sync with the current code. | ||
If you're using VS Code, you can manually restart the language server by opening the command palette and selecting _"TypeScript: Restart TS Server."_ | ||
Open the command pallete with: | ||
- `Ctrl` + `Shift` + `P` if you're on Windows or Linux. | ||
- `Cmd` + `Shift` + `P` if you're on a Mac. | ||
|
||
::: |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
:::tip Keep Wasp start running | ||
|
||
`wasp start` automatically picks up the changes you make, regenerates the code, and restarts the app. So keep it running in the background. | ||
|
||
It also improves your experience by tracking the working directory and ensuring the generated code/types are up to date with your changes. | ||
|
||
::: |
57 changes: 57 additions & 0 deletions
57
web/versioned_docs/version-0.14.0/advanced/accessing-app-config.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
title: Accessing the configuration | ||
--- | ||
|
||
Whenever you start a Wasp app, you are starting two processes. | ||
- **The client process** - A React app that implements your app's frontend. | ||
|
||
During development, this is a dev server with hot reloading. In production, | ||
it's a simple process that serves pre-built static files with environment variables | ||
embedded during the build (details depend on [how you deploy it](/advanced/deployment/overview.md)). | ||
|
||
- **The server process** - An Express server that implements your app's backend. | ||
|
||
During development, this is an Express server controlled by a | ||
[`nodemon`](https://www.npmjs.com/package/nodemon) process that takes care of | ||
hot reloading and restarts. In production, it's a regular Express server run | ||
using Node. | ||
|
||
Check [the introduction](/introduction/introduction.md) for a more in-depth explanation of Wasp's runtime architecture. | ||
|
||
You can configure both processes through environment variables. See [the deployment instructions](/advanced/deployment/manually.md#environment-variables) for a full list of supported variables. | ||
|
||
Wasp gives you runtime access to the processes' configurations through **configuration objects**. | ||
|
||
## Server configuration object | ||
|
||
The server configuration object contains these fields: | ||
|
||
- `frontendUrl: String` - Set it with env var `WASP_WEB_CLIENT_URL`. | ||
|
||
The URL of your client (the app's frontend).<br/> | ||
Wasp automatically sets it during development when you run `wasp start`.<br/> | ||
In production, you should set it to your client's URL as the server sees it | ||
(i.e., with the DNS and proxies considered). | ||
|
||
You can access it like this: | ||
```js | ||
import { config } from 'wasp/server' | ||
|
||
console.log(config.frontendUrl) | ||
``` | ||
|
||
## Client configuration object | ||
The client configuration object contains these fields: | ||
- `apiUrl: String` - Set it with env var `REACT_APP_API_URL` | ||
|
||
The URL of your server (the app's backend).<br/> | ||
Wasp automatically sets it during development when you run `wasp start`.<br/> | ||
In production, it should contain the value of your server's URL as the user's browser | ||
sees it (i.e., with the DNS and proxies considered). | ||
|
||
You can access it like this: | ||
```js | ||
import { config } from 'wasp/client' | ||
|
||
console.log(config.apiUrl) | ||
``` |
Oops, something went wrong.