Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config base url includes the port #164

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const config = {
* The base external URL of this DWN.
* This is used to construct URL paths such as the `Request URI` in the Web5 Connect flow.
*/
baseUrl: process.env.DWN_BASE_URL || 'http://localhost',
baseUrl: process.env.DWN_BASE_URL || 'http://localhost:3000',

/**
* Port that server listens on.
Expand Down
2 changes: 1 addition & 1 deletion src/http-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class HttpApi {

// create the Web5 Connect Server
httpApi.web5ConnectServer = await Web5ConnectServer.create({
baseUrl: `${config.baseUrl}:${config.port}`,
baseUrl: config.baseUrl,
sqlTtlCacheUrl: config.ttlCacheUrl,
});

Expand Down
5 changes: 2 additions & 3 deletions tests/http-api.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,7 @@ describe('http api', function () {

describe('P0 Scenarios', function () {
it('should be able to read and write a protocol record', async function () {
const dwnUrl = `${config.baseUrl}:${config.port}`;
await CommonScenarioValidator.sanityTestDwnReadWrite(dwnUrl, alice)
await CommonScenarioValidator.sanityTestDwnReadWrite(config.baseUrl, alice)
});
});

Expand Down Expand Up @@ -924,7 +923,7 @@ describe('http api', function () {
expect(resp.status).to.equal(200);

const info = await resp.json();
expect(info['url']).to.equal('http://localhost');
expect(info['url']).to.equal('http://localhost:3000');
expect(info['server']).to.equal('@web5/dwn-server');
expect(info['registrationRequirements']).to.include('terms-of-service');
expect(info['registrationRequirements']).to.include(
Expand Down
3 changes: 1 addition & 2 deletions tests/scenarios/dynamic-plugin-loading.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ describe('Dynamic DWN plugin loading', function () {
expect(customEventStreamConstructorSpy.calledOnce).to.be.true;

// 3. Validate that the DWN instance is using the custom data store plugin.
const dwnUrl = `${dwnServerConfigCopy.baseUrl}:${dwnServerConfigCopy.port}`;
await CommonScenarioValidator.sanityTestDwnReadWrite(dwnUrl);
await CommonScenarioValidator.sanityTestDwnReadWrite(dwnServerConfigCopy.baseUrl);
});
});
Loading