From 4cf29512476659f7c1e730a6b927953892ecb53c Mon Sep 17 00:00:00 2001 From: Fabian Engelniederhammer Date: Wed, 3 Apr 2024 12:34:38 +0200 Subject: [PATCH] fix(lapis2-docs): use relative links so that they work when deployed behind a proxy #725 --- .idea/runConfigurations/lapis2_docs.xml | 2 ++ lapis2-docs/README.md | 2 +- lapis2-docs/astro.config.mjs | 32 +++++++++---------- .../Configuration/MetadataTypesList.astro | 3 +- .../docs/concepts/ambiguous-symbols.mdx | 2 +- .../docs/concepts/mutation-filters.mdx | 2 +- .../docs/concepts/pango-lineage-query.mdx | 11 ++++--- .../src/content/docs/concepts/request-id.mdx | 2 +- .../content/docs/concepts/request-methods.mdx | 6 ++-- .../content/docs/concepts/response-format.mdx | 6 ++-- .../content/docs/concepts/variant-query.mdx | 4 +-- .../docs/getting-started/introduction.mdx | 4 +-- .../references/database-configuration.mdx | 16 +++++----- .../references/preprocessing.mdx | 16 +++++----- .../references/reference-genomes.mdx | 8 ++--- .../references/starting-silo-and-lapis.mdx | 12 +++---- .../tutorials/start-lapis-and-silo.mdx | 4 +-- .../additional-request-properties.mdx | 2 +- .../content/docs/references/introduction.mdx | 12 +++---- lapis2-docs/test-docker-compose.yml | 1 + lapis2-docs/tests/docs.spec.ts | 2 +- lapis2-docs/tests/queryGenerator.page.ts | 2 +- 22 files changed, 77 insertions(+), 74 deletions(-) diff --git a/.idea/runConfigurations/lapis2_docs.xml b/.idea/runConfigurations/lapis2_docs.xml index 05461b432..76ccc9647 100644 --- a/.idea/runConfigurations/lapis2_docs.xml +++ b/.idea/runConfigurations/lapis2_docs.xml @@ -7,6 +7,8 @@ + + diff --git a/lapis2-docs/README.md b/lapis2-docs/README.md index b8faf05a1..5d86b6b4c 100644 --- a/lapis2-docs/README.md +++ b/lapis2-docs/README.md @@ -8,7 +8,7 @@ This documentation is a website built with | Command | Action | |:--------------------------|:-------------------------------------------------| | `npm install` | Installs dependencies | -| `npm run dev` | Starts local dev server at `localhost:3000` | +| `npm run dev` | Starts local dev server at `localhost:4321` | | `npm run build` | Build your production site to `./dist/` | | `npm run preview` | Preview your build locally, before deploying | | `npm run astro ...` | Run CLI commands like `astro add`, `astro check` | diff --git a/lapis2-docs/astro.config.mjs b/lapis2-docs/astro.config.mjs index 2eededebf..333b82b1d 100644 --- a/lapis2-docs/astro.config.mjs +++ b/lapis2-docs/astro.config.mjs @@ -36,35 +36,35 @@ export default defineConfig({ items: [ { label: 'Introduction', - link: '/references/introduction/', + link: '/references/introduction', }, { label: 'Fields', - link: '/references/fields/', + link: '/references/fields', }, { label: 'Filters', - link: '/references/filters/', + link: '/references/filters', }, { label: 'Additional Request Properties', - link: '/references/additional-request-properties/', + link: '/references/additional-request-properties', }, { label: 'Open API / Swagger', - link: '/references/open-api-definition/', + link: '/references/open-api-definition', }, { label: 'Database Config', - link: '/references/database-config/', + link: '/references/database-config', }, { label: 'Reference Genomes', - link: '/references/reference-genomes/', + link: '/references/reference-genomes', }, { label: 'Nucleotide And Amino Acid Symbols', - link: '/references/nucleotide-and-amino-acid-symbols/', + link: '/references/nucleotide-and-amino-acid-symbols', }, ], }, @@ -73,37 +73,37 @@ export default defineConfig({ items: filterAvailableConcepts([ { label: 'Data versions', - link: '/concepts/data-versions/', + link: '/concepts/data-versions', }, { label: 'Mutation filters', - link: '/concepts/mutation-filters/', + link: '/concepts/mutation-filters', }, { label: 'Ambiguous symbols', - link: '/concepts/ambiguous-symbols/', + link: '/concepts/ambiguous-symbols', }, { label: 'Pango lineage query', - link: '/concepts/pango-lineage-query/', + link: '/concepts/pango-lineage-query', onlyIfFeature: 'sarsCoV2VariantQuery', }, { label: 'Request methods: GET and POST', - link: '/concepts/request-methods/', + link: '/concepts/request-methods', }, { label: 'Response format', - link: '/concepts/response-format/', + link: '/concepts/response-format', }, { label: 'Variant query', - link: '/concepts/variant-query/', + link: '/concepts/variant-query', onlyIfFeature: 'sarsCoV2VariantQuery', }, { label: 'Request Id', - link: '/concepts/request-id/', + link: '/concepts/request-id', }, ]), }, diff --git a/lapis2-docs/src/components/Configuration/MetadataTypesList.astro b/lapis2-docs/src/components/Configuration/MetadataTypesList.astro index 917effc0a..2ea1fb629 100644 --- a/lapis2-docs/src/components/Configuration/MetadataTypesList.astro +++ b/lapis2-docs/src/components/Configuration/MetadataTypesList.astro @@ -1,6 +1,7 @@ --- import { OnlyIf } from '../OnlyIf.tsx'; import { getConfig } from '../../config.ts'; +import BaseAwareLink from '../BaseAwareLink.astro'; --- SILO currently supports the following metadata types: @@ -13,7 +14,7 @@ SILO currently supports the following metadata types: pango_lineage: Systematic classification of lineage with inheritance structure that can be computed for some pathogens. m.type === 'pango_lineage')}> - Also see here. + Also see here.
  • date: Values must be valid dates in the form YYYY-MM-DD.
  • diff --git a/lapis2-docs/src/content/docs/concepts/ambiguous-symbols.mdx b/lapis2-docs/src/content/docs/concepts/ambiguous-symbols.mdx index 0f4e172ac..e995215a5 100644 --- a/lapis2-docs/src/content/docs/concepts/ambiguous-symbols.mdx +++ b/lapis2-docs/src/content/docs/concepts/ambiguous-symbols.mdx @@ -3,7 +3,7 @@ title: Ambiguous symbols description: Explanation how ambiguous reads are handled in the data --- -[The symbols page](/references/nucleotide-and-amino-acid-symbols) +[The symbols page](../references/nucleotide-and-amino-acid-symbols) lists all symbols that the underlying sequence files in `.FASTA` format can contain. The ambiguous symbols arise from imperfect reads in the sequencer. diff --git a/lapis2-docs/src/content/docs/concepts/mutation-filters.mdx b/lapis2-docs/src/content/docs/concepts/mutation-filters.mdx index 242ddaac9..b8814610d 100644 --- a/lapis2-docs/src/content/docs/concepts/mutation-filters.mdx +++ b/lapis2-docs/src/content/docs/concepts/mutation-filters.mdx @@ -23,6 +23,6 @@ i.e. has the same base as the reference genome at the specified position. :::note Both, nucleotide and amino acid mutation filter, also support `Maybe` queries. -Read more in [ambiguous symbols](/concepts/ambiguous-symbols). +Read more in [ambiguous symbols](../concepts/ambiguous-symbols). **Example:** . ::: diff --git a/lapis2-docs/src/content/docs/concepts/pango-lineage-query.mdx b/lapis2-docs/src/content/docs/concepts/pango-lineage-query.mdx index 51084c204..817461309 100644 --- a/lapis2-docs/src/content/docs/concepts/pango-lineage-query.mdx +++ b/lapis2-docs/src/content/docs/concepts/pango-lineage-query.mdx @@ -4,7 +4,7 @@ description: Pango lineage query --- import { OnlyIf } from '../../../components/OnlyIf.tsx'; -import { getConfig } from '../../../config.ts'; +import { getConfig, hasFeature } from '../../../config.ts'; m.type === 'pango_lineage')}> @@ -12,10 +12,11 @@ Pango lineage names inherit the hierarchical nature of genetic lineages. For exa More information about the pango nomenclature can be found on the website of the [Pango network](https://www.pango.network/). -With the pangoLineage filter and in [variant queries](/concepts/variant-query/), it is possible to not only filter for a very -specific lineage but also to include its sub-lineages. To include sub-lineages, add a `*` at the end. For example, -writing B.1.351 will only give samples of B.1.351. Writing B.1.351* or B.1.351.* (there is no difference between these -two options) will return B.1.351, B.1.351.1, B.1.351.2, etc. +With the pangoLineage filter and in [variant queries](../concepts/variant-query/), +it is possible to not only filter for a very specific lineage but also to include its sub-lineages. +To include sub-lineages, add a `*` at the end. +For example, writing B.1.351 will only give samples of B.1.351. +Writing B.1.351* or B.1.351.* (there is no difference between these two options) will return B.1.351, B.1.351.1, B.1.351.2, etc. An official pango lineage name can only have at most three number components. A sub-lineage of a lineage with a maximal-length name (e.g., B.1.617.2) will get an alias. A list of aliases can be found diff --git a/lapis2-docs/src/content/docs/concepts/request-id.mdx b/lapis2-docs/src/content/docs/concepts/request-id.mdx index cbcedb6c6..533231452 100644 --- a/lapis2-docs/src/content/docs/concepts/request-id.mdx +++ b/lapis2-docs/src/content/docs/concepts/request-id.mdx @@ -13,7 +13,7 @@ This will greatly simplify identifying the problem in our log files. You can provide a request id in the request as an HTTP header `X-Request-Id`. This is useful if you want to correlate requests in your own log files with the LAPIS log files -to track problems across systems. +to track problems across systems, e.g. if your own API calls LAPIS. :::caution If you use the `X-Request-Id` header, make sure that the value is unique. diff --git a/lapis2-docs/src/content/docs/concepts/request-methods.mdx b/lapis2-docs/src/content/docs/concepts/request-methods.mdx index fa445750e..47012bd90 100644 --- a/lapis2-docs/src/content/docs/concepts/request-methods.mdx +++ b/lapis2-docs/src/content/docs/concepts/request-methods.mdx @@ -53,9 +53,7 @@ example code for doing it with curl and from R and Python: -{/* prettier-ignore */} :::note -This is a general example and will only work on instances that have the fields `region`, -`country`, and `date`. Check out the [fields](../../references/fields/) and [filters](../../references/filters/) page to -see information about this instance. {/* prettier-ignore */} +This is a general example and will only work on instances that have the fields `region`, `country`, and `date`. +Check out the [fields](../references/fields/) and [filters](../references/filters/) page to see information about this instance. ::: diff --git a/lapis2-docs/src/content/docs/concepts/response-format.mdx b/lapis2-docs/src/content/docs/concepts/response-format.mdx index 51db204a6..8d3a620f2 100644 --- a/lapis2-docs/src/content/docs/concepts/response-format.mdx +++ b/lapis2-docs/src/content/docs/concepts/response-format.mdx @@ -4,7 +4,7 @@ description: Response format --- The response format is tailored to each specific endpoint. -To view the response format for a particular endpoint, please visit our [Swagger UI](/references/open-api-definition/). +To view the response format for a particular endpoint, please visit our [Swagger UI](../references/open-api-definition/). Once there, select the endpoint of interest and scroll down to the "Responses" section. A '200' response code indicates a successful request, while any other code signifies an error. @@ -15,7 +15,7 @@ Genomic sequences (such as those from `unalignedNucleotideSequences`, `alignedAm ## Example -To understand the response from the `nucleotideMutation` endpoint, refer to the relevant section in the Swagger UI: +To understand the response of the `nucleotideMutation` endpoint, refer to the relevant section in the Swagger UI: ![Example nucleotide mutation response](../../../images/concepts/example_nucleotide_mutation_response_200.png) @@ -30,5 +30,5 @@ Fields marked with an asterisk (\*) are always included in the response; unmarke :::note Every response, regardless of format, includes the data version as it is crucial information. For more details, visit the -[data versions page](/concepts/data-versions/). +[data versions page](../concepts/data-versions/). ::: diff --git a/lapis2-docs/src/content/docs/concepts/variant-query.mdx b/lapis2-docs/src/content/docs/concepts/variant-query.mdx index ce85fbaee..4bbc704bd 100644 --- a/lapis2-docs/src/content/docs/concepts/variant-query.mdx +++ b/lapis2-docs/src/content/docs/concepts/variant-query.mdx @@ -48,14 +48,14 @@ Get the sequences that fulfill exactly 2 out of 4 conditions: [exactly-2-of: 123A & 234T, !234T, S:345- | S:346-, [2-of: 222T, 333G, 444A, 555C]] ``` -For SARS-CoV-2, it is also possible to use [Pango lineage queries](/concepts/pango-lineage-query/) (either called by pangolin +For SARS-CoV-2, it is also possible to use [Pango lineage queries](../concepts/pango-lineage-query/) (either called by pangolin or by Nextclade) and filter by Nextstrain clades: ``` BA.5* | nextcladePangoLineage:BA.5* | nextstrainClade:22B ``` -LAPIS supports a ternary logic to query [ambiguous nucleotide symbols](/concepts/ambiguous-symbols/). +LAPIS supports a ternary logic to query [ambiguous nucleotide symbols](../concepts/ambiguous-symbols/). ``` MAYBE(123W) diff --git a/lapis2-docs/src/content/docs/getting-started/introduction.mdx b/lapis2-docs/src/content/docs/getting-started/introduction.mdx index ad434282f..9d1f6327a 100644 --- a/lapis2-docs/src/content/docs/getting-started/introduction.mdx +++ b/lapis2-docs/src/content/docs/getting-started/introduction.mdx @@ -20,7 +20,7 @@ to answer genomic epidemiological questions. Main features include: engine. :::tip -To get started, you can use our [**interactive wizard**](/getting-started/generate-your-request/) to generate your query. +To get started, you can use our [**interactive wizard**](./generate-your-request/) to generate your query. We provide code examples for Python and R. ::: @@ -43,5 +43,5 @@ If you have any trouble, feel free to reach out to us. :::note This documentation also includes a section about how to set up your own instance of LAPIS. -Refer to [this tutorial](/maintainer-docs/tutorials/start-lapis-and-silo/) for a quick start guide. +Refer to [this tutorial](../maintainer-docs/tutorials/start-lapis-and-silo/) for a quick start guide. ::: diff --git a/lapis2-docs/src/content/docs/maintainer-docs/references/database-configuration.mdx b/lapis2-docs/src/content/docs/maintainer-docs/references/database-configuration.mdx index 59ae7bad0..a40bab1e1 100644 --- a/lapis2-docs/src/content/docs/maintainer-docs/references/database-configuration.mdx +++ b/lapis2-docs/src/content/docs/maintainer-docs/references/database-configuration.mdx @@ -9,8 +9,8 @@ import { hasFeature } from '../../../../config.ts'; LAPIS and SILO need a `database_config.yaml`. It's main purpose is to define the database schema for the sequence metadata. -See the [tutorial](/maintainer-docs/tutorials/start-lapis-and-silo#writing-configuration) for an example, -or use our [config generator](/maintainer-docs/tutorials/generate-your-config) to generate your own config. +See the [tutorial](../tutorials/start-lapis-and-silo#writing-configuration) for an example, +or use our [config generator](../tutorials/generate-your-config) to generate your own config. More examples can be found in our tests. The database config is considered static configuration that doesn't change with data updates. @@ -46,11 +46,11 @@ it will be beneficial to set `dateToSortBy` to that column. The metadata object permits the following fields: -| Key | Type | Required | Description | -| ------------- | ------- | -------- | --------------------------------------------------------------------------------------------------- | -| name | string | true | The name of the feature. | -| type | enum | true | The [type of the metadata](#metadata-types). | -| generateIndex | boolean | false | Some [metadata types](#metadata-types) permit generating an index for faster queries on the column. | +| Key | Type | Required | Description | +| ------------- | ------- | -------- | ----------------------------------------------------- | +| name | string | true | The name of the feature. | +| type | enum | true | The [type of the metadata](#metadata-types). | +| generateIndex | boolean | false | See [Generating an index](#generating-an-index) below | ### Metadata Types @@ -78,4 +78,4 @@ The feature object permits the following fields: Currently, there is only one available feature: `sarsCoV2VariantQuery`. This enables a specialized query language for SARS-CoV-2 instances. -See [variant queries](/concepts/variant-query). +See [variant queries](../../concepts/variant-query). diff --git a/lapis2-docs/src/content/docs/maintainer-docs/references/preprocessing.mdx b/lapis2-docs/src/content/docs/maintainer-docs/references/preprocessing.mdx index 6e330a2bd..ec63aa05b 100644 --- a/lapis2-docs/src/content/docs/maintainer-docs/references/preprocessing.mdx +++ b/lapis2-docs/src/content/docs/maintainer-docs/references/preprocessing.mdx @@ -70,7 +70,7 @@ All filenames are relative to the `inputDirectory`. The file with Pango lineage definitions, relative to the inputDirectory. See the section on the [Pango Lineage Definition File below](#the-pango-lineage-definition-file) for details. - `referenceGenomeFilename`: - The file with [reference genomes](/maintainer-docs/references/reference-genomes), relative to the inputDirectory. + The file with [reference genomes](../references/reference-genomes), relative to the inputDirectory. ## `NDJSON` Format @@ -90,7 +90,7 @@ Each line in the NDJSON file must be a JSON object with the following keys: :::note You must configure two metadata columns for insertions in the -[database configuration](/maintainer-docs/references/database-configuration) +[database configuration](../references/database-configuration) with the exact names and types as in this snippet: ```yaml @@ -109,20 +109,20 @@ Otherwise, SILO will not recognize insertions in the NDJSON format. The sequences object contains sequences for each segment or gene. It must include all `nucleotideSequences` (or `genes`, respectively) specified in the -[reference genomes](/maintainer-docs/references/reference-genomes) +[reference genomes](../references/reference-genomes) as keys. Its values are the sequences as strings of -[valid symbols](/references/nucleotide-and-amino-acid-symbols) +[valid symbols](../../references/nucleotide-and-amino-acid-symbols) or `null`. #### Insertions Object The insertions object contains a list of insertions for each segment or gene. It must include all `nucleotideSequences` (or `genes`, respectively) specified in the -[reference genomes](/maintainer-docs/references/reference-genomes) +[reference genomes](../references/reference-genomes) as keys. Its values are arrays of strings in the format `:`. -The insertions must consist of [valid symbols](/references/nucleotide-and-amino-acid-symbols). +The insertions must consist of [valid symbols](../../references/nucleotide-and-amino-acid-symbols). #### Example of the Schema @@ -184,7 +184,7 @@ SILO expects the following files in the `inputDirectory`: ### Metadata File The metadata file must be a TSV (tab-separated values) file. -Its columns must correspond to the metadata fields specified in the [database configuration](/maintainer-docs/references/database-configuration). +Its columns must correspond to the metadata fields specified in the [database configuration](../references/database-configuration). Empty values will be interpreted as `null`. #### Example @@ -228,7 +228,7 @@ The filenames must follow this pattern: The `gene_` prefix is configurable in the preprocessing configuration via `genePrefix`. There must be one corresponding file for every segment and gene defined in the -[reference genomes](/maintainer-docs/references/reference-genomes). +[reference genomes](../references/reference-genomes). The header in the FASTA files must match the `primaryKey` column in the metadata file. There must be a one-to-one correspondence between entries in the metadata file and sequences in the FASTA files. diff --git a/lapis2-docs/src/content/docs/maintainer-docs/references/reference-genomes.mdx b/lapis2-docs/src/content/docs/maintainer-docs/references/reference-genomes.mdx index 85074b041..d07584aba 100644 --- a/lapis2-docs/src/content/docs/maintainer-docs/references/reference-genomes.mdx +++ b/lapis2-docs/src/content/docs/maintainer-docs/references/reference-genomes.mdx @@ -39,7 +39,7 @@ The file must contain a JSON object with two keys: A reference sequence is a JSON object that permits the following keys: -| Key | Type | Required | Description | -| -------- | ------ | -------- | ----------------------------------------------------------------------------------------------- | -| name | string | true | The name of the sequence. Must be unique. | -| sequence | string | true | The sequence. See [here for allowed characters](/references/nucleotide-and-amino-acid-symbols). | +| Key | Type | Required | Description | +| -------- | ------ | -------- | ---------------------------------------------------------------------------------------------------- | +| name | string | true | The name of the sequence. Must be unique. | +| sequence | string | true | The sequence. See [here for allowed characters](../../references/nucleotide-and-amino-acid-symbols). | diff --git a/lapis2-docs/src/content/docs/maintainer-docs/references/starting-silo-and-lapis.mdx b/lapis2-docs/src/content/docs/maintainer-docs/references/starting-silo-and-lapis.mdx index 0f13f1ba8..82088566d 100644 --- a/lapis2-docs/src/content/docs/maintainer-docs/references/starting-silo-and-lapis.mdx +++ b/lapis2-docs/src/content/docs/maintainer-docs/references/starting-silo-and-lapis.mdx @@ -4,7 +4,7 @@ description: Reference on how to start the SILO and LAPIS applications --- :::note -The [corresponding tutorial](/maintainer-docs/tutorials/start-lapis-and-silo) +The [corresponding tutorial](../tutorials/start-lapis-and-silo) shows an example step by step. This page aims to provide a full reference. ::: @@ -28,14 +28,14 @@ and terminate after the result is written to the output directory. Optionally, you can specify: - `--preprocessingConfig`: - The path to the [preprocessing config](/maintainer-docs/references/preprocessing#preprocessing-config) file that SILO should use, + The path to the [preprocessing config](../references/preprocessing#preprocessing-config) file that SILO should use, e.g. `~/LAPIS/preprocessing_config.yaml` - `--databaseConfig`: - The path to the [database config](/maintainer-docs/references/database-configuration) file that SILO should use, + The path to the [database config](../references/database-configuration) file that SILO should use, e.g. `~/LAPIS/database_config.yaml`. If those parameters are not provided, SILO will try to read the files from its current working directory. -See the [preprocessing reference](/maintainer-docs/references/preprocessing#preprocessing-config) +See the [preprocessing reference](../references/preprocessing#preprocessing-config) for how to provide the input files. #### Starting the SILO preprocessing with Docker @@ -74,10 +74,10 @@ To start LAPIS you need to provide the following parameters: - `--silo.url`: The URL where SILO is running, e.g. `http://localhost:8081`. - `--lapis.databaseConfig.path`: - The path to the [database config](/maintainer-docs/references/database-configuration) file that LAPIS should use, + The path to the [database config](../references/database-configuration) file that LAPIS should use, e.g. `~/LAPIS/database_config.yaml`. - `--referenceGenomeFilename`: - The path to the [reference genomes](/maintainer-docs/references/reference-genomes) file that LAPIS should use, + The path to the [reference genomes](../references/reference-genomes) file that LAPIS should use, e.g. `~/reference_genomes.json`. This can alternatively be passed via the environment variable `REFERENCE_GENOME_ENV_VARIABLE_NAME`. The parameter takes precedence over the environment variable. diff --git a/lapis2-docs/src/content/docs/maintainer-docs/tutorials/start-lapis-and-silo.mdx b/lapis2-docs/src/content/docs/maintainer-docs/tutorials/start-lapis-and-silo.mdx index 68e52e078..98e159541 100644 --- a/lapis2-docs/src/content/docs/maintainer-docs/tutorials/start-lapis-and-silo.mdx +++ b/lapis2-docs/src/content/docs/maintainer-docs/tutorials/start-lapis-and-silo.mdx @@ -67,13 +67,13 @@ schema: ``` :::tip -See the [config reference](/maintainer-docs/references/database-configuration) for a full specification. +See the [config reference](../references/database-configuration) for a full specification. ::: ### Starting SILO Preprocessing :::note -Refer to [Preprocessing](/maintainer-docs/references/preprocessing) for more explanation +Refer to [Preprocessing](../references/preprocessing) for more explanation and a full reference of the preprocessing. ::: diff --git a/lapis2-docs/src/content/docs/references/additional-request-properties.mdx b/lapis2-docs/src/content/docs/references/additional-request-properties.mdx index 4cc658cc4..79a9b06cf 100644 --- a/lapis2-docs/src/content/docs/references/additional-request-properties.mdx +++ b/lapis2-docs/src/content/docs/references/additional-request-properties.mdx @@ -6,7 +6,7 @@ description: Request properties that are not sequence filters Most of the request properties are sequence filters. However, there are some properties that influence the response data in other ways. -Check the [Swagger UI](/references/open-api-definition/) for the full specification. +Check the [Swagger UI](../references/open-api-definition/) for the full specification. ## Ordering The Results diff --git a/lapis2-docs/src/content/docs/references/introduction.mdx b/lapis2-docs/src/content/docs/references/introduction.mdx index 38803ea6b..1ab05de69 100644 --- a/lapis2-docs/src/content/docs/references/introduction.mdx +++ b/lapis2-docs/src/content/docs/references/introduction.mdx @@ -9,10 +9,10 @@ This section covers the basics of using LAPIS. LAPIS is accessible through various endpoints, each serving a distinct purpose and returning different data. For instance, the `GET /sample/aggregated` endpoint returns the count of sequences that meet specified filter criteria. -Every endpoint accepts [`GET` and `POST`](/concepts/request-methods) requests. +Every endpoint accepts [`GET` and `POST`](../concepts/request-methods) requests. Both methods yield identical data; however, the manner of providing the filter criteria differs. -The various endpoints are listed in the [Open API / Swagger](/references/open-api-definition/) documentation, +The various endpoints are listed in the [Open API / Swagger](../references/open-api-definition/) documentation, which also offers a convenient testing interface via Swagger-UI. ## Filters @@ -20,12 +20,12 @@ which also offers a convenient testing interface via Swagger-UI. The output from each endpoint can be refined using various parameters. For instance, to determine the number of sequences originating from Germany, you would use `GET /sample/aggregated?country=Germany`. -The available filters are detailed in [Filters](/references/filters/), -and you can experiment with them at [Open API / Swagger](/references/open-api-definition/). +The available filters are detailed in [Filters](../references/filters/), +and you can experiment with them at [Open API / Swagger](../references/open-api-definition/). ## Fields Fields allow you to dictate the grouping of the returned data. For example, to find out the number of sequences from each country,you would use `GET /sample/aggregated?fields=country`. -The available fields are documented in [Fields](/references/fields/), -and you can test them at [Open API / Swagger](/references/open-api-definition/). +The available fields are documented in [Fields](../references/fields/), +and you can test them at [Open API / Swagger](../references/open-api-definition/). diff --git a/lapis2-docs/test-docker-compose.yml b/lapis2-docs/test-docker-compose.yml index 6922da4fd..69ccb8b36 100644 --- a/lapis2-docs/test-docker-compose.yml +++ b/lapis2-docs/test-docker-compose.yml @@ -9,3 +9,4 @@ services: - ../siloLapisTests/testData/reference_genomes.json:/config/reference_genomes.json environment: LAPIS_URL: http://localhost:8090 + BASE_URL: /docs/ diff --git a/lapis2-docs/tests/docs.spec.ts b/lapis2-docs/tests/docs.spec.ts index 393cbe42c..3fd0b5c79 100644 --- a/lapis2-docs/tests/docs.spec.ts +++ b/lapis2-docs/tests/docs.spec.ts @@ -113,7 +113,7 @@ test.describe('The documentation', () => { test(`should have working relative links and next button on page ${documentationPage.relativeUrl}`, async ({ page, }) => { - await page.goto(baseUrl + documentationPage.relativeUrl); + await page.goto(baseUrl.slice(0, -1) + documentationPage.relativeUrl); await clickOnAllRelativeLinksInMainBody(page); diff --git a/lapis2-docs/tests/queryGenerator.page.ts b/lapis2-docs/tests/queryGenerator.page.ts index 0fc93696c..bcf34f69f 100644 --- a/lapis2-docs/tests/queryGenerator.page.ts +++ b/lapis2-docs/tests/queryGenerator.page.ts @@ -1,6 +1,6 @@ import { expect, Locator, Page, test } from '@playwright/test'; -export const baseUrl = 'http://localhost:4321'; +export const baseUrl = 'http://localhost:4321/docs/'; export const queryGeneratorTest = test.extend<{ queryGeneratorPage: QueryGeneratorPage }>({ queryGeneratorPage: async ({ page }, use) => {