Skip to content

Commit 503ef9c

Browse files
committed
docs: running local dev server for website
1 parent a2861c3 commit 503ef9c

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,25 @@ with the service name.
124124
serverless auth deploy
125125
```
126126

127+
The `website` service is a static website that is served from an AWS Lambda
128+
function. As such, it can run locally without needing to use Dev Mode. However,
129+
it has a dependency on the AI Chat service and the Auth service, so you must
130+
configure environment variables locally.
131+
132+
```
133+
# If you have the jq CLI command installed you can use that with the --json flag
134+
# on serverless info to get the URLs from the deployed services. If you do not
135+
# have jq installed, you can get the URLs by running "serverless auth info" and
136+
# "serverless ai-chat info" and copying the URLs manually into the environment
137+
# variables.
138+
export VITE_CHAT_API_URL=$(serverless aiChatApi info --json | jq -r '.outputs[] | select(.OutputKey == "ChatApiUrl") | .OutputValue')
139+
export VITE_AUTH_API_URL=$(serverless auth info --json | jq -r '.outputs[] | select(.OutputKey == "AuthApiUrl") | .OutputValue')
140+
141+
# now you can run the local development server
142+
cd website/app
143+
npm run build
144+
```
145+
127146
## 4. Prepare & release to prod
128147

129148
Now that the app is up and running in a development environment, lets get it
@@ -155,8 +174,10 @@ https://us-east-1.console.aws.amazon.com/acm/home?region=us-east-1#/certificates
155174
This example uses a Certificate with the following full qualified domain names:
156175

157176
```
177+
158178
awsaistack.com
159-
*.awsaistack.com
179+
\*.awsaistack.com
180+
160181
```
161182

162183
The base domain name, `awsaistack.com` is used for the website service
@@ -189,7 +210,9 @@ with a key like `/awsaistack/shared-token`, and set it in the
189210
`sharedTokenSecret` parameter in the `serverless-compose.yml` file:
190211

191212
```
213+
192214
sharedTokenSecret: ${ssm:/awsaistack/shared-token}
215+
193216
```
194217

195218
### Deploy to prod
@@ -198,7 +221,9 @@ Once you've setup the custom domain name (optional), and created the secret, you
198221
are ready to deploy the service to prod.
199222

200223
```
224+
201225
serverless deploy --stage prod
226+
202227
```
203228

204229
Now you can use the service by visiting your domain name, or

package-lock.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

website/app/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
8-
"watch": "vite build --watch --outDir ../.serverless/build/app/build",
98
"build": "vite build",
109
"lint": "eslint .",
1110
"preview": "vite preview"

0 commit comments

Comments
 (0)