Skip to content

Commit f505241

Browse files
committed
chore: add mock server to agent webapp
1 parent 7b4093a commit f505241

File tree

10 files changed

+68
-17
lines changed

10 files changed

+68
-17
lines changed

package-lock.json

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"clientPrincipal": {
3+
"userId": "abc123",
4+
"userRoles": [
5+
"anonymous",
6+
"authenticated"
7+
],
8+
"claims": [],
9+
"identityProvider": "aad",
10+
"userDetails": "John Doe"
11+
}
12+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ok
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[
2+
{
3+
"role": "user",
4+
"content": "What burgers do you have on the menu?"
5+
},
6+
{
7+
"role": "assistant",
8+
"content": "Here’s our current burger menu (10 items):\n\n- Classic American Cheeseburger — $10.99 — Angus beef, American cheese, lettuce, tomato, onion, house sauce. \n- Smoky BBQ Bacon Burger — $12.49 — Beef, BBQ sauce, bacon, cheddar, onion rings, pickles. \n- Spicy Jalapeño Fiesta Burger — $11.99 — Beef, pepper jack, jalapeños, chipotle mayo, avocado. \n- Mushroom Swiss Gourmet — $12.29 — Beef, sautéed mushrooms, Swiss, caramelized onions, garlic aioli. \n- Southern Fried Chicken Burger — $11.49 — Crispy chicken, coleslaw, spicy mayo, dill pickles. \n- Cali Veggie Supreme (Vegetarian) — $10.79 — Grilled veggie patty, provolone, sprouts, herb aioli. \n- Spiced Chickpea Vegan Burger (Vegan) — $10.99 — Chickpea patty, vegan tzatziki, arugula, pickles. \n- Tokyo Teriyaki Fusion Burger — $12.59 — Teriyaki-glazed beef, grilled pineapple, wasabi mayo. \n- Mediterranean Lamb Burger — $13.49 — Lamb, feta, tzatziki, grilled eggplant, arugula. \n- Gluten-Free Avocado Turkey Burger (Gluten-Free) — $11.99 — Turkey, avocado, pepper jack, honey mustard.\n\nWould you like details on toppings or nutrition, or to place an order?\n\n<<Would you like to place an order now?>>\n<<See available toppings?>>\n<<Any dietary restrictions or preferences?>>"
9+
}
10+
]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[
2+
{
3+
"id": "123",
4+
"title": "Burger Menu"
5+
}
6+
]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"id":"abcd1234",
3+
"createdAt":"2025-09-02T07:55:28.204Z"
4+
}

packages/agent-webapp/mocks/post_api#chats#stream

Lines changed: 3 additions & 0 deletions
Large diffs are not rendered by default.

packages/agent-webapp/package.json

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,29 @@
66
"type": "module",
77
"scripts": {
88
"start": "swa start",
9-
"dev": "concurrently \"npm:dev:*\" --kill-others",
10-
"dev:vite": "vite --port 5174 --host",
11-
"dev:api": "cd ../agent-api && npm run start",
9+
"start:mock": "swa start mock",
10+
"swa:start": "concurrently npm:serve:api npm:serve:webapp --kill-others",
11+
"swa:startmock": "concurrently npm:serve:mocks npm:serve:webapp --kill-others",
12+
"serve:mocks": "smoke -p 7072 -h 127.0.0.1 mocks",
13+
"serve:api": "cd ../agent-api && npm run start",
14+
"serve:webapp": "npm run dev -s",
15+
"dev": "vite --port 5174 --host",
1216
"build": "vite build",
13-
"watch": "vite build --watch --minify false",
17+
"preview": "vite preview",
1418
"clean": "npx rimraf dist"
1519
},
1620
"author": "Microsoft",
1721
"license": "MIT",
1822
"dependencies": {
1923
"@microsoft/ai-chat-protocol": "^1.0.0-beta.20240814.1",
20-
"lit": "^3.0.0",
21-
"marked": "^12.0.0",
22-
"dompurify": "^3.0.0"
24+
"dompurify": "^3.0.0",
25+
"lit": "^3.0.0",
26+
"marked": "^12.0.0"
2327
},
2428
"devDependencies": {
25-
"vite": "^7.0.0",
26-
"@types/dompurify": "^3.0.0"
29+
"@types/dompurify": "^3.0.0",
30+
"smoke": "^4.1.3",
31+
"vite": "^7.0.0"
2732
},
2833
"files": [
2934
"dist"

packages/agent-webapp/swa-cli.config.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
{
22
"$schema": "https://aka.ms/azure/static-web-apps-cli/schema",
33
"configurations": {
4-
"registration-webapp": {
4+
"api": {
55
"appLocation": ".",
6-
"run": "npm run dev",
6+
"run": "npm run swa:start",
7+
"appDevserverUrl": "http://localhost:5174",
8+
"apiDevserverUrl": "http://localhost:7072",
9+
"appBuildCommand": "npm run build",
10+
"outputLocation": "dist"
11+
},
12+
"mock": {
13+
"appLocation": ".",
14+
"run": "npm run swa:startmock",
715
"appDevserverUrl": "http://localhost:5174",
816
"apiDevserverUrl": "http://localhost:7072",
917
"appBuildCommand": "npm run build",

packages/burger-webapp/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@
1212
"serve:webapp": "npm run dev -s",
1313
"dev": "vite",
1414
"build": "tsc && vite build",
15-
"preview": "vite preview"
15+
"preview": "vite preview",
16+
"clean": "npx rimraf dist"
1617
},
1718
"dependencies": {
1819
"lit": "^3.3.0"
1920
},
2021
"devDependencies": {
21-
"smoke": "^4.0.0",
22+
"smoke": "^4.1.3",
2223
"vite": "^7.0.0"
2324
},
2425
"engines": {

0 commit comments

Comments
 (0)