Skip to content

Commit

Permalink
fix: use /.well-known/wot instead of /well-known/wot
Browse files Browse the repository at this point in the history
Related to #6
  • Loading branch information
relu91 committed Aug 1, 2022
1 parent e7b2988 commit 4b4b768
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/introduction/well-known.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { WellKnownService } from './well-known.service';
* @see https://w3c.github.io/wot-discovery/#introduction-well-known
*/
@ApiTags('Introduction')
@Controller('well-known')
@Controller('.well-known')
export class WellKnownController {
public constructor(private readonly service: WellKnownService) {}

Expand Down
2 changes: 1 addition & 1 deletion static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ <h6>Version 1.0.0-alpha.0</h6>
</div>
<div class="row">

<div class="one offset-by-four-half column"><a href="./well-known/wot"><img class="icon" src="./images/td.png"></img></a></div>
<div class="one offset-by-four-half column"><a href="./.well-known/wot"><img class="icon" src="./images/td.png"></img></a></div>
<div class="one column"><a href="https://github.com/vaimee/zion"><img class="icon" src="./images/github.png"></img></a></div>
<div class="one column"><a href="./explorer"><img class="icon" src="./images/swagger.png"></img></a></div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/well-known.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ describe('/well-known', () => {
describe(`/${SPECIFICATION_PATH}`, () => {
describe('GET', () => {
it('should answer to well-known', async () => {
const { status } = await axios.get(`/well-known/${SPECIFICATION_PATH}`);
const { status } = await axios.get(`/.well-known/${SPECIFICATION_PATH}`);
expect(status).toBe(200);
});

it('should answer with a valid Thing Description', async () => {
const { status, data } = await axios.get(`/well-known/${SPECIFICATION_PATH}`);
const { status, data } = await axios.get(`/.well-known/${SPECIFICATION_PATH}`);
const result = validateThingDescription(data);

expect(status).toBe(200);
Expand All @@ -43,7 +43,7 @@ describe('/well-known', () => {
* @see https://w3c.github.io/wot-discovery/#exploration-self
*/
it('should follow the specification', async () => {
const { status, headers, data } = await axios.get(`/well-known/${SPECIFICATION_PATH}`);
const { status, headers, data } = await axios.get(`/.well-known/${SPECIFICATION_PATH}`);
const result = validateThingDescription(data);

expect(status).toBe(200);
Expand All @@ -59,7 +59,7 @@ describe('/well-known', () => {
* @see https://w3c.github.io/wot-discovery/#exploration-self
*/
it('should answer to HEAD according to specification', async () => {
const { status, headers } = await axios.head(`/well-known/${SPECIFICATION_PATH}`);
const { status, headers } = await axios.head(`/.well-known/${SPECIFICATION_PATH}`);

expect(status).toBe(200);
expect(headers['content-type']).toContain('application/td+json');
Expand Down

0 comments on commit 4b4b768

Please sign in to comment.