From ba8b2c20367f3257315c8836197b2dbc560b9d0d Mon Sep 17 00:00:00 2001 From: Jose Celano Date: Wed, 28 Jun 2023 12:40:35 +0100 Subject: [PATCH] feat!: change default API port to 3001 To avoid conflict with the frontend default port for nuxt. --- Dockerfile | 4 ++-- README.md | 2 +- compose.yaml | 2 +- config-idx-back.local.toml | 2 +- config.local.toml | 2 +- docker/README.md | 4 ++-- docker/bin/run.sh | 2 +- src/config.rs | 4 ++-- src/lib.rs | 6 +++--- src/services/proxy.rs | 2 +- src/web/api/v1/auth.rs | 6 +++--- src/web/api/v1/contexts/about/mod.rs | 4 ++-- src/web/api/v1/contexts/category/mod.rs | 6 +++--- src/web/api/v1/contexts/proxy/mod.rs | 4 ++-- src/web/api/v1/contexts/settings/mod.rs | 12 ++++++------ src/web/api/v1/contexts/tag/mod.rs | 6 +++--- src/web/api/v1/contexts/torrent/mod.rs | 12 ++++++------ src/web/api/v1/contexts/user/mod.rs | 10 +++++----- tests/e2e/environment.rs | 2 +- tests/e2e/mod.rs | 2 +- tests/environments/shared.rs | 4 ++-- 21 files changed, 49 insertions(+), 49 deletions(-) diff --git a/Dockerfile b/Dockerfile index 08744910..ffdd7ef0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ FROM chef as development WORKDIR /app ARG UID=1000 ARG RUN_AS_USER=appuser -ARG IDX_BACK_API_PORT=3000 +ARG IDX_BACK_API_PORT=3001 # Add the app user for development ENV USER=appuser ENV UID=$UID @@ -57,7 +57,7 @@ RUN strip /app/target/x86_64-unknown-linux-musl/release/main FROM alpine:latest WORKDIR /app ARG RUN_AS_USER=appuser -ARG IDX_BACK_API_PORT=3000 +ARG IDX_BACK_API_PORT=3001 RUN apk --no-cache add ca-certificates ENV TZ=Etc/UTC ENV RUN_AS_USER=$RUN_AS_USER diff --git a/README.md b/README.md index 73224ade..7067293c 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ git clone https://github.com/torrust/torrust-index-backend.git \ And then run `cargo run` twice. The first time to generate the `config.toml` file and the second time to run the backend with the default configuration. -After running the tracker the API will be available at . +After running the tracker the API will be available at . ## Documentation diff --git a/compose.yaml b/compose.yaml index 8c672f00..2c46d9df 100644 --- a/compose.yaml +++ b/compose.yaml @@ -16,7 +16,7 @@ services: networks: - server_side ports: - - 3000:3000 + - 3001:3001 # todo: implement healthcheck #healthcheck: # test: diff --git a/config-idx-back.local.toml b/config-idx-back.local.toml index 9b6264f6..4b359800 100644 --- a/config-idx-back.local.toml +++ b/config-idx-back.local.toml @@ -11,7 +11,7 @@ token = "MyAccessToken" token_valid_seconds = 7257600 [net] -port = 3000 +port = 3001 [auth] email_on_signup = "Optional" diff --git a/config.local.toml b/config.local.toml index 3bb1093e..06f89a3c 100644 --- a/config.local.toml +++ b/config.local.toml @@ -11,7 +11,7 @@ token = "MyAccessToken" token_valid_seconds = 7257600 [net] -port = 3000 +port = 3001 [auth] email_on_signup = "Optional" diff --git a/docker/README.md b/docker/README.md index 3dbfa038..be47bfad 100644 --- a/docker/README.md +++ b/docker/README.md @@ -33,7 +33,7 @@ Run using the pre-built public docker image: export TORRUST_IDX_BACK_USER_UID=$(id -u) docker run -it \ --user="$TORRUST_IDX_BACK_USER_UID" \ - --publish 3000:3000/tcp \ + --publish 3001:3001/tcp \ --volume "$(pwd)/storage":"/app/storage" \ torrust/index-backend ``` @@ -75,7 +75,7 @@ After running the "up" command you will have three running containers: ```s $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES -e35b14edaceb torrust-idx-back "cargo run" 19 seconds ago Up 17 seconds 0.0.0.0:3000->3000/tcp, :::3000->3000/tcp torrust-idx-back-1 +e35b14edaceb torrust-idx-back "cargo run" 19 seconds ago Up 17 seconds 0.0.0.0:3001->3001/tcp, :::3001->3001/tcp torrust-idx-back-1 ddbad9fb496a torrust/tracker:develop "/app/torrust-tracker" 19 seconds ago Up 18 seconds 0.0.0.0:1212->1212/tcp, :::1212->1212/tcp, 0.0.0.0:6969->6969/udp, :::6969->6969/udp, 7070/tcp torrust-tracker-1 f1d991d62170 mysql:8.0 "docker-entrypoint.s…" 3 hours ago Up 18 seconds (healthy) 0.0.0.0:3306->3306/tcp, :::3306->3306/tcp, 33060/tcp torrust-mysql-1 torrust-mysql-1 diff --git a/docker/bin/run.sh b/docker/bin/run.sh index 92417f9a..48b86f02 100755 --- a/docker/bin/run.sh +++ b/docker/bin/run.sh @@ -5,7 +5,7 @@ TORRUST_IDX_BACK_CONFIG=$(cat config.toml) docker run -it \ --user="$TORRUST_IDX_BACK_USER_UID" \ - --publish 3000:3000/tcp \ + --publish 3001:3001/tcp \ --env TORRUST_IDX_BACK_CONFIG="$TORRUST_IDX_BACK_CONFIG" \ --volume "$(pwd)/storage":"/app/storage" \ torrust-index-backend diff --git a/src/config.rs b/src/config.rs index 9906d2ad..d75d6f6e 100644 --- a/src/config.rs +++ b/src/config.rs @@ -80,7 +80,7 @@ pub const FREE_PORT: u16 = 0; /// The the base URL for the API. #[derive(Debug, Clone, Serialize, Deserialize)] pub struct Network { - /// The port to listen on. Default to `3000`. + /// The port to listen on. Default to `3001`. pub port: u16, /// The base URL for the API. For example: `http://localhost`. /// If not set, the base URL will be inferred from the request. @@ -90,7 +90,7 @@ pub struct Network { impl Default for Network { fn default() -> Self { Self { - port: 3000, + port: 3001, base_url: None, } } diff --git a/src/lib.rs b/src/lib.rs index ae01a9a5..faffb360 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -113,7 +113,7 @@ //! && export TORRUST_IDX_BACK_USER_UID=1000 \ //! && docker run -it \ //! --user="$TORRUST_IDX_BACK_USER_UID" \ -//! --publish 3000:3000/tcp \ +//! --publish 3001:3001/tcp \ //! --volume "$(pwd)/storage":"/app/storage" \ //! torrust/index-backend //! ``` @@ -167,7 +167,7 @@ //! token_valid_seconds = 7257600 //! //! [net] -//! port = 3000 +//! port = 3001 //! //! [auth] //! email_on_signup = "Optional" @@ -223,7 +223,7 @@ //! //! ## API //! -//! Running the tracker with the default configuration will expose the REST API on port 3000: +//! Running the backend with the default configuration will expose the REST API on port 3001: //! //! ## Tracker Statistics Importer //! diff --git a/src/services/proxy.rs b/src/services/proxy.rs index 248747c1..9ea5ef3d 100644 --- a/src/services/proxy.rs +++ b/src/services/proxy.rs @@ -5,7 +5,7 @@ //! //! Sample URL: //! -//! +//! use std::sync::Arc; use bytes::Bytes; diff --git a/src/web/api/v1/auth.rs b/src/web/api/v1/auth.rs index 3967aa28..f98436e3 100644 --- a/src/web/api/v1/auth.rs +++ b/src/web/api/v1/auth.rs @@ -17,7 +17,7 @@ //! --header "Content-Type: application/json" \ //! --request POST \ //! --data '{"username":"indexadmin","email":"indexadmin@torrust.com","password":"BenoitMandelbrot1924","confirm_password":"BenoitMandelbrot1924"}' \ -//! http://127.0.0.1:3000/v1/user/register +//! http://127.0.0.1:3001/v1/user/register //! ``` //! //! **NOTICE**: The first user is automatically an administrator. Currently, @@ -34,7 +34,7 @@ //! --header "Content-Type: application/json" \ //! --request POST \ //! --data '{"login":"indexadmin","password":"BenoitMandelbrot1924"}' \ -//! http://127.0.0.1:3000/v1/user/login +//! http://127.0.0.1:3001/v1/user/login //! ``` //! //! **Response** @@ -68,7 +68,7 @@ //! --header "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjp7InVzZXJfaWQiOjEsInVzZXJuYW1lIjoiaW5kZXhhZG1pbiIsImFkbWluaXN0cmF0b3IiOnRydWV9LCJleHAiOjE2ODYyMTU3ODh9.4k8ty27DiWwOk4WVcYEhIrAndhpXMRWnLZ3i_HlJnvI" \ //! --request POST \ //! --data '{"name":"new category","icon":null}' \ -//! http://127.0.0.1:3000/v1/category +//! http://127.0.0.1:3001/v1/category //! ``` //! //! **Response** diff --git a/src/web/api/v1/contexts/about/mod.rs b/src/web/api/v1/contexts/about/mod.rs index bde0696a..6f397ab6 100644 --- a/src/web/api/v1/contexts/about/mod.rs +++ b/src/web/api/v1/contexts/about/mod.rs @@ -17,7 +17,7 @@ //! **Example request** //! //! ```bash -//! curl "http://127.0.0.1:3000/v1/about" +//! curl "http://127.0.0.1:3001/v1/about" //! ``` //! //! **Example response** `200` @@ -49,7 +49,7 @@ //! **Example request** //! //! ```bash -//! curl "http://127.0.0.1:3000/v1/about/license" +//! curl "http://127.0.0.1:3001/v1/about/license" //! ``` //! //! **Example response** `200` diff --git a/src/web/api/v1/contexts/category/mod.rs b/src/web/api/v1/contexts/category/mod.rs index 804faf27..c6ed8a71 100644 --- a/src/web/api/v1/contexts/category/mod.rs +++ b/src/web/api/v1/contexts/category/mod.rs @@ -20,7 +20,7 @@ //! **Example request** //! //! ```bash -//! curl "http://127.0.0.1:3000/v1/category" +//! curl "http://127.0.0.1:3001/v1/category" //! ``` //! //! **Example response** `200` @@ -84,7 +84,7 @@ //! --header "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjp7InVzZXJfaWQiOjEsInVzZXJuYW1lIjoiaW5kZXhhZG1pbiIsImFkbWluaXN0cmF0b3IiOnRydWV9LCJleHAiOjE2ODYyMTU3ODh9.4k8ty27DiWwOk4WVcYEhIrAndhpXMRWnLZ3i_HlJnvI" \ //! --request POST \ //! --data '{"name":"new category","icon":null}' \ -//! http://127.0.0.1:3000/v1/category +//! http://127.0.0.1:3001/v1/category //! ``` //! //! **Example response** `200` @@ -122,7 +122,7 @@ //! --header "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjp7InVzZXJfaWQiOjEsInVzZXJuYW1lIjoiaW5kZXhhZG1pbiIsImFkbWluaXN0cmF0b3IiOnRydWV9LCJleHAiOjE2ODYyMTU3ODh9.4k8ty27DiWwOk4WVcYEhIrAndhpXMRWnLZ3i_HlJnvI" \ //! --request DELETE \ //! --data '{"name":"new category","icon":null}' \ -//! http://127.0.0.1:3000/v1/category +//! http://127.0.0.1:3001/v1/category //! ``` //! //! **Example response** `200` diff --git a/src/web/api/v1/contexts/proxy/mod.rs b/src/web/api/v1/contexts/proxy/mod.rs index a6adae1a..f0d54ce9 100644 --- a/src/web/api/v1/contexts/proxy/mod.rs +++ b/src/web/api/v1/contexts/proxy/mod.rs @@ -38,7 +38,7 @@ //! --header "cache-control: no-cache" \ //! --header "pragma: no-cache" \ //! --output mandelbrotset.jpg \ -//! http://0.0.0.0:3000/v1/proxy/image/https%3A%2F%2Fraw.git.ttaallkk.top%2Ftorrust%2Ftorrust-index-backend%2Fdevelop%2Fdocs%2Fmedia%2Ftorrust_logo.png +//! http://0.0.0.0:3001/v1/proxy/image/https%3A%2F%2Fraw.git.ttaallkk.top%2Ftorrust%2Ftorrust-index-backend%2Fdevelop%2Fdocs%2Fmedia%2Ftorrust_logo.png //! ``` //! //! You will receive an image with the text "Sign in to see image" instead. @@ -51,7 +51,7 @@ //! --header "cache-control: no-cache" \ //! --header "pragma: no-cache" \ //! --output mandelbrotset.jpg \ -//! http://0.0.0.0:3000/v1/proxy/image/https%3A%2F%2Fraw.git.ttaallkk.top%2Ftorrust%2Ftorrust-index-backend%2Fdevelop%2Fdocs%2Fmedia%2Ftorrust_logo.png +//! http://0.0.0.0:3001/v1/proxy/image/https%3A%2F%2Fraw.git.ttaallkk.top%2Ftorrust%2Ftorrust-index-backend%2Fdevelop%2Fdocs%2Fmedia%2Ftorrust_logo.png //! ``` pub mod handlers; pub mod responses; diff --git a/src/web/api/v1/contexts/settings/mod.rs b/src/web/api/v1/contexts/settings/mod.rs index 40f511f2..371a46db 100644 --- a/src/web/api/v1/contexts/settings/mod.rs +++ b/src/web/api/v1/contexts/settings/mod.rs @@ -22,7 +22,7 @@ //! --header "Content-Type: application/json" \ //! --header "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjp7InVzZXJfaWQiOjEsInVzZXJuYW1lIjoiaW5kZXhhZG1pbiIsImFkbWluaXN0cmF0b3IiOnRydWV9LCJleHAiOjE2ODYyMTU3ODh9.4k8ty27DiWwOk4WVcYEhIrAndhpXMRWnLZ3i_HlJnvI" \ //! --request GET \ -//! "http://127.0.0.1:3000/v1/settings" +//! "http://127.0.0.1:3001/v1/settings" //! ``` //! //! **Example response** `200` @@ -41,7 +41,7 @@ //! "token_valid_seconds": 7257600 //! }, //! "net": { -//! "port": 3000, +//! "port": 3001, //! "base_url": null //! }, //! "auth": { @@ -101,8 +101,8 @@ //! --header "Content-Type: application/json" \ //! --header "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjp7InVzZXJfaWQiOjEsInVzZXJuYW1lIjoiaW5kZXhhZG1pbiIsImFkbWluaXN0cmF0b3IiOnRydWV9LCJleHAiOjE2ODYyMTU3ODh9.4k8ty27DiWwOk4WVcYEhIrAndhpXMRWnLZ3i_HlJnvI" \ //! --request POST \ -//! --data '{"website":{"name":"Torrust"},"tracker":{"url":"udp://localhost:6969","mode":"Public","api_url":"http://localhost:1212","token":"MyAccessToken","token_valid_seconds":7257600},"net":{"port":3000,"base_url":null},"auth":{"email_on_signup":"Optional","min_password_length":6,"max_password_length":64,"secret_key":"MaxVerstappenWC2021"},"database":{"connect_url":"sqlite://./storage/database/data.db?mode=rwc"},"mail":{"email_verification_enabled":false,"from":"example@email.com","reply_to":"noreply@email.com","username":"","password":"","server":"","port":25},"image_cache":{"max_request_timeout_ms":1000,"capacity":128000000,"entry_size_limit":4000000,"user_quota_period_seconds":3600,"user_quota_bytes":64000000},"api":{"default_torrent_page_size":10,"max_torrent_page_size":30},"tracker_statistics_importer":{"torrent_info_update_interval":3600}}' \ -//! "http://127.0.0.1:3000/v1/settings" +//! --data '{"website":{"name":"Torrust"},"tracker":{"url":"udp://localhost:6969","mode":"Public","api_url":"http://localhost:1212","token":"MyAccessToken","token_valid_seconds":7257600},"net":{"port":3001,"base_url":null},"auth":{"email_on_signup":"Optional","min_password_length":6,"max_password_length":64,"secret_key":"MaxVerstappenWC2021"},"database":{"connect_url":"sqlite://./storage/database/data.db?mode=rwc"},"mail":{"email_verification_enabled":false,"from":"example@email.com","reply_to":"noreply@email.com","username":"","password":"","server":"","port":25},"image_cache":{"max_request_timeout_ms":1000,"capacity":128000000,"entry_size_limit":4000000,"user_quota_period_seconds":3600,"user_quota_bytes":64000000},"api":{"default_torrent_page_size":10,"max_torrent_page_size":30},"tracker_statistics_importer":{"torrent_info_update_interval":3600}}' \ +//! "http://127.0.0.1:3001/v1/settings" //! ``` //! //! The response contains the settings that were updated. @@ -124,7 +124,7 @@ //! curl \ //! --header "Content-Type: application/json" \ //! --request GET \ -//! "http://127.0.0.1:3000/v1/settings/name" +//! "http://127.0.0.1:3001/v1/settings/name" //! ``` //! //! **Example response** `200` @@ -147,7 +147,7 @@ //! curl \ //! --header "Content-Type: application/json" \ //! --request GET \ -//! "http://127.0.0.1:3000/v1/settings/public" +//! "http://127.0.0.1:3001/v1/settings/public" //! ``` //! //! **Example response** `200` diff --git a/src/web/api/v1/contexts/tag/mod.rs b/src/web/api/v1/contexts/tag/mod.rs index 1d4d77de..eb4dd68d 100644 --- a/src/web/api/v1/contexts/tag/mod.rs +++ b/src/web/api/v1/contexts/tag/mod.rs @@ -20,7 +20,7 @@ //! **Example request** //! //! ```bash -//! curl "http://127.0.0.1:3000/v1/tags" +//! curl "http://127.0.0.1:3001/v1/tags" //! ``` //! //! **Example response** `200` @@ -64,7 +64,7 @@ //! --header "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjp7InVzZXJfaWQiOjEsInVzZXJuYW1lIjoiaW5kZXhhZG1pbiIsImFkbWluaXN0cmF0b3IiOnRydWV9LCJleHAiOjE2ODYyMTU3ODh9.4k8ty27DiWwOk4WVcYEhIrAndhpXMRWnLZ3i_HlJnvI" \ //! --request POST \ //! --data '{"name":"new tag"}' \ -//! http://127.0.0.1:3000/v1/tag +//! http://127.0.0.1:3001/v1/tag //! ``` //! //! **Example response** `200` @@ -101,7 +101,7 @@ //! --header "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjp7InVzZXJfaWQiOjEsInVzZXJuYW1lIjoiaW5kZXhhZG1pbiIsImFkbWluaXN0cmF0b3IiOnRydWV9LCJleHAiOjE2ODYyMTU3ODh9.4k8ty27DiWwOk4WVcYEhIrAndhpXMRWnLZ3i_HlJnvI" \ //! --request DELETE \ //! --data '{"tag_id":1}' \ -//! http://127.0.0.1:3000/v1/tag +//! http://127.0.0.1:3001/v1/tag //! ``` //! //! **Example response** `200` diff --git a/src/web/api/v1/contexts/torrent/mod.rs b/src/web/api/v1/contexts/torrent/mod.rs index 6041e468..6553ba7f 100644 --- a/src/web/api/v1/contexts/torrent/mod.rs +++ b/src/web/api/v1/contexts/torrent/mod.rs @@ -28,7 +28,7 @@ //! --form "description=MandelbrotSet image" \ //! --form "category=software" \ //! --form "torrent=@docs/media/mandelbrot_2048x2048_infohash_v1.png.torrent;type=application/x-bittorrent" \ -//! "http://127.0.0.1:3000/v1/torrent/upload" +//! "http://127.0.0.1:3001/v1/torrent/upload" //! ``` //! //! **Example response** `200` @@ -63,7 +63,7 @@ //! --header "Content-Type: application/x-bittorrent" \ //! --header "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjp7InVzZXJfaWQiOjEsInVzZXJuYW1lIjoiaW5kZXhhZG1pbiIsImFkbWluaXN0cmF0b3IiOnRydWV9LCJleHAiOjE2ODYyMTU3ODh9.4k8ty27DiWwOk4WVcYEhIrAndhpXMRWnLZ3i_HlJnvI" \ //! --output mandelbrot_2048x2048_infohash_v1.png.torrent \ -//! "http://127.0.0.1:3000/v1/torrent/download/5452869BE36F9F3350CCEE6B4544E7E76CAAADAB" +//! "http://127.0.0.1:3001/v1/torrent/download/5452869BE36F9F3350CCEE6B4544E7E76CAAADAB" //! ``` //! //! **Example response** `200` @@ -105,7 +105,7 @@ //! --header "Content-Type: application/json" \ //! --header "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjp7InVzZXJfaWQiOjEsInVzZXJuYW1lIjoiaW5kZXhhZG1pbiIsImFkbWluaXN0cmF0b3IiOnRydWV9LCJleHAiOjE2ODYyMTU3ODh9.4k8ty27DiWwOk4WVcYEhIrAndhpXMRWnLZ3i_HlJnvI" \ //! --request GET \ -//! "http://127.0.0.1:3000/v1/torrent/5452869BE36F9F3350CCEE6B4544E7E76CAAADAB" +//! "http://127.0.0.1:3001/v1/torrent/5452869BE36F9F3350CCEE6B4544E7E76CAAADAB" //! ``` //! //! **Example response** `200` @@ -191,7 +191,7 @@ //! --header "Content-Type: application/json" \ //! --header "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjp7InVzZXJfaWQiOjEsInVzZXJuYW1lIjoiaW5kZXhhZG1pbiIsImFkbWluaXN0cmF0b3IiOnRydWV9LCJleHAiOjE2ODYyMTU3ODh9.4k8ty27DiWwOk4WVcYEhIrAndhpXMRWnLZ3i_HlJnvI" \ //! --request GET \ -//! "http://127.0.0.1:3000/v1/torrents" +//! "http://127.0.0.1:3001/v1/torrents" //! ``` //! //! **Example response** `200` @@ -256,7 +256,7 @@ //! --header "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjp7InVzZXJfaWQiOjEsInVzZXJuYW1lIjoiaW5kZXhhZG1pbiIsImFkbWluaXN0cmF0b3IiOnRydWV9LCJleHAiOjE2ODYyMTU3ODh9.4k8ty27DiWwOk4WVcYEhIrAndhpXMRWnLZ3i_HlJnvI" \ //! --request PUT \ //! --data '{"title":"MandelbrotSet", "description":"MandelbrotSet image"}' \ -//! "http://127.0.0.1:3000/v1/torrent/5452869BE36F9F3350CCEE6B4544E7E76CAAADAB" +//! "http://127.0.0.1:3001/v1/torrent/5452869BE36F9F3350CCEE6B4544E7E76CAAADAB" //! ``` //! //! **Example response** `200` @@ -312,7 +312,7 @@ //! --header "Content-Type: application/json" \ //! --header "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjp7InVzZXJfaWQiOjEsInVzZXJuYW1lIjoiaW5kZXhhZG1pbiIsImFkbWluaXN0cmF0b3IiOnRydWV9LCJleHAiOjE2ODYyMTU3ODh9.4k8ty27DiWwOk4WVcYEhIrAndhpXMRWnLZ3i_HlJnvI" \ //! --request DELETE \ -//! "http://127.0.0.1:3000/v1/torrent/5452869BE36F9F3350CCEE6B4544E7E76CAAADAB" +//! "http://127.0.0.1:3001/v1/torrent/5452869BE36F9F3350CCEE6B4544E7E76CAAADAB" //! ``` //! //! **Example response** `200` diff --git a/src/web/api/v1/contexts/user/mod.rs b/src/web/api/v1/contexts/user/mod.rs index 0b0b0eb5..4f4682e0 100644 --- a/src/web/api/v1/contexts/user/mod.rs +++ b/src/web/api/v1/contexts/user/mod.rs @@ -60,7 +60,7 @@ //! --header "Content-Type: application/json" \ //! --request POST \ //! --data '{"username":"indexadmin","email":"indexadmin@torrust.com","password":"BenoitMandelbrot1924","confirm_password":"BenoitMandelbrot1924"}' \ -//! http://127.0.0.1:3000/v1/user/register +//! http://127.0.0.1:3001/v1/user/register //! ``` //! //! For more information about the registration process, refer to the [`auth`](crate::web::api::v1::auth) @@ -107,7 +107,7 @@ //! --header "Content-Type: application/json" \ //! --request POST \ //! --data '{"login":"indexadmin","password":"BenoitMandelbrot1924"}' \ -//! http://127.0.0.1:3000/v1/user/login +//! http://127.0.0.1:3001/v1/user/login //! ``` //! //! For more information about the login process, refer to the [`auth`](crate::web::api::v1::auth) @@ -135,7 +135,7 @@ //! --header "Content-Type: application/json" \ //! --request POST \ //! --data '{"token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjp7InVzZXJfaWQiOjEsInVzZXJuYW1lIjoiaW5kZXhhZG1pbiIsImFkbWluaXN0cmF0b3IiOnRydWV9LCJleHAiOjE2ODYyMTU3ODh9.4k8ty27DiWwOk4WVcYEhIrAndhpXMRWnLZ3i_HlJnvI"}' \ -//! http://127.0.0.1:3000/v1/user/token/verify +//! http://127.0.0.1:3001/v1/user/token/verify //! ``` //! //! **Example response** `200` @@ -181,7 +181,7 @@ //! --header "Content-Type: application/json" \ //! --request POST \ //! --data '{"token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjp7InVzZXJfaWQiOjEsInVzZXJuYW1lIjoiaW5kZXhhZG1pbiIsImFkbWluaXN0cmF0b3IiOnRydWV9LCJleHAiOjE2ODYyMTU3ODh9.4k8ty27DiWwOk4WVcYEhIrAndhpXMRWnLZ3i_HlJnvI"}' \ -//! http://127.0.0.1:3000/v1/user/token/renew +//! http://127.0.0.1:3001/v1/user/token/renew //! ``` //! //! **Example response** `200` @@ -227,7 +227,7 @@ //! --header "Content-Type: application/json" \ //! --header "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjp7InVzZXJfaWQiOjEsInVzZXJuYW1lIjoiaW5kZXhhZG1pbiIsImFkbWluaXN0cmF0b3IiOnRydWV9LCJleHAiOjE2ODYyMTU3ODh9.4k8ty27DiWwOk4WVcYEhIrAndhpXMRWnLZ3i_HlJnvI" \ //! --request DELETE \ -//! http://127.0.0.1:3000/v1/user/ban/indexadmin +//! http://127.0.0.1:3001/v1/user/ban/indexadmin //! ``` //! //! **Example response** `200` diff --git a/tests/e2e/environment.rs b/tests/e2e/environment.rs index 4684fd82..d5022785 100644 --- a/tests/e2e/environment.rs +++ b/tests/e2e/environment.rs @@ -86,7 +86,7 @@ impl TestEnv { } /// Provides the API server socket address. - /// For example: `localhost:3000`. + /// For example: `localhost:3001`. pub fn server_socket_addr(&self) -> Option { match self.state() { State::RunningShared => self.shared.as_ref().unwrap().server_socket_addr(), diff --git a/tests/e2e/mod.rs b/tests/e2e/mod.rs index 2b909fd9..3d0c58a0 100644 --- a/tests/e2e/mod.rs +++ b/tests/e2e/mod.rs @@ -7,7 +7,7 @@ //! set the environment variable `TORRUST_IDX_BACK_E2E_SHARED` to `true`. //! //! > **NOTICE**: The server must be running before running the tests. The -//! server url is hardcoded to `http://localhost:3000` for now. We are planning +//! server url is hardcoded to `http://localhost:3001` for now. We are planning //! to make it configurable in the future via a environment variable. //! //! ```text diff --git a/tests/environments/shared.rs b/tests/environments/shared.rs index 1920f0cd..d9db57be 100644 --- a/tests/environments/shared.rs +++ b/tests/environments/shared.rs @@ -25,7 +25,7 @@ impl TestEnv { #[must_use] pub fn server_socket_addr(&self) -> Option { // If the E2E configuration uses port 0 in the future instead of a - // predefined port (right now we are using port 3000) we will + // predefined port (right now we are using port 3001) we will // need to pass an env var with the port used by the server. Some(self.authority.clone()) } @@ -34,7 +34,7 @@ impl TestEnv { impl Default for TestEnv { fn default() -> Self { Self { - authority: "localhost:3000".to_string(), + authority: "localhost:3001".to_string(), } } }