Skip to content

Commit

Permalink
Remove old instance setup + update readme + run ui on port 3002 (#334)
Browse files Browse the repository at this point in the history
* Remove old instance setup + update readme + run ui on port 3002

* Fix port in tests
  • Loading branch information
jaclarke authored Feb 29, 2024
1 parent 8bcf0c0 commit 881b16d
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 32 deletions.
14 changes: 7 additions & 7 deletions web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ To start the UI dev server:
yarn start
```

The app is served at `http://localhost:3000/ui`.
The app is served at `http://localhost:3002/ui`.

The EdgeDB server needs to be run separately with CORS and
admin UI enabled, e.g.:
The EdgeDB server needs to be run separately with `cors_allow_origins`
configured to allow the UI's `localhost:3002` origin:

```sh
# Using dev server:
env EDGEDB_DEBUG_HTTP_INJECT_CORS=1 edb server --admin-ui=enabled
edb server

# Only needs to be run once:
edb cli configure set cors_allow_origins '*'

# or with a nightly instance:
env EDGEDB_DEBUG_HTTP_INJECT_CORS=1 edgedb instance start --foreground <instance-name>
```

To customize the EdgeDB server address (if it's not running at the
Expand Down
1 change: 0 additions & 1 deletion web/devkeys/jwt

This file was deleted.

5 changes: 0 additions & 5 deletions web/devkeys/private.pem

This file was deleted.

4 changes: 0 additions & 4 deletions web/devkeys/public.pem

This file was deleted.

8 changes: 0 additions & 8 deletions web/openBrowser.js

This file was deleted.

4 changes: 1 addition & 3 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,10 @@
},
"homepage": "./ui",
"scripts": {
"start": "BROWSER=none craco start",
"start": "PORT=3002 BROWSER=none craco start",
"build": "craco build",
"test": "jest --runInBand",
"eject": "react-scripts eject",
"dev-server": "env EDGEDB_DEBUG_HTTP_INJECT_CORS=1 edb server",
"open-browser": "node openBrowser.js",
"lint": "tsc --noEmit"
},
"eslintConfig": {
Expand Down
4 changes: 2 additions & 2 deletions web/tests/_globalSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ async function waitUntilAlive(

async function checkUIServerAlive() {
return new Promise<boolean>((resolve) => {
const req = http.get("http://127.0.0.1:3000/", (res) => {
const req = http.get("http://127.0.0.1:3002/", (res) => {
if (res.statusCode === 200) {
resolve(true);
} else {
Expand Down Expand Up @@ -128,7 +128,7 @@ export default async function globalSetup() {
const uiServerAlive = new Event();

if (await checkUIServerAlive()) {
console.log("Re-using UI server already running on 3000");
console.log("Re-using UI server already running on 3002");
uiServerAlive.set();
} else {
console.log("Starting UI server...");
Expand Down
2 changes: 1 addition & 1 deletion web/tests/_testenv.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class SeleniumEnvironment extends NodeEnvironment {
.build();

try {
await driver.get("http://localhost:3000/ui?authToken=test");
await driver.get("http://localhost:3002/ui?authToken=test");
} catch (err) {
driver.quit();
throw err;
Expand Down
2 changes: 1 addition & 1 deletion web/tests/_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type {Locator, WebElement} from "selenium-webdriver";
export const client = createClient({port: 5656, tlsSecurity: "insecure"});

export function goToPage(url: string) {
return driver.get(`http://localhost:3000/ui/${url}`);
return driver.get(`http://localhost:3002/ui/${url}`);
}

export function uiClass(className: string) {
Expand Down

0 comments on commit 881b16d

Please sign in to comment.