Skip to content

Commit

Permalink
Merge pull request loco-rs#611 from dinosath/5150_default_port
Browse files Browse the repository at this point in the history
feat: change default port to 5150
  • Loading branch information
jondot committed Jun 14, 2024
2 parents 75d5af9 + 4e6e6f3 commit 33b334f
Show file tree
Hide file tree
Showing 39 changed files with 69 additions and 69 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ Example of pulling a port from environment:

```yaml
server:
port: {{ get_env(name="NODE_PORT", default=3000) }}
port: {{ get_env(name="NODE_PORT", default=5150) }}
```

It is possible to use any `tera` templating constructs such as loops, conditionals, etc. inside YAML configuration files.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ $ cargo loco start
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
https://loco.rs

listening on port 3000
listening on port 5150
```
<!-- </snip> -->

Expand Down
2 changes: 1 addition & 1 deletion docs-site/content/blog/angular-frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ As you may have noticed Angular has built the frontend into `frontend/dist/front
## Start Loco

1. Start Loco with `cargo loco start`
2. Open https://localhost:3000/
2. Open https://localhost:5150/

You should now see the Angular starter Website :smile:
4 changes: 2 additions & 2 deletions docs-site/content/blog/axum-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ pub fn routes() -> Routes {
}
```

Now, you can call the `https://127.0.0.1:3000/api/mysession` endpoint to see the session.
Now, you can call the `https://127.0.0.1:5150/api/mysession` endpoint to see the session.

## Creating Session With DB Encryption

Expand Down Expand Up @@ -194,4 +194,4 @@ pub fn routes() -> Routes {

```

Now, calling the `https://127.0.0.1:3000/api/mysession` endpoint will display the session.
Now, calling the `https://127.0.0.1:5150/api/mysession` endpoint will display the session.
10 changes: 5 additions & 5 deletions docs-site/content/blog/deploy-aws.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ resource "aws_ecs_task_definition" "myapp_task" {
"essential": true,
"portMappings": [
{
"containerPort": 3000
"containerPort": 5150
}
],
"command": ["start"],
Expand Down Expand Up @@ -255,7 +255,7 @@ resource "aws_security_group" "load_balancer_security_group" {
}
resource "aws_lb_target_group" "myapp" {
name = "myapp-tg"
port = 3000
port = 5150
protocol = "HTTP"
target_type = "ip"
vpc_id = aws_vpc.myapp_vpc.id
Expand Down Expand Up @@ -311,7 +311,7 @@ resource "aws_ecs_service" "myapp" {
load_balancer {
target_group_arn = aws_lb_target_group.myapp.arn
container_name = aws_ecs_task_definition.myapp_task.family
container_port = 3000
container_port = 5150
}
network_configuration {
Expand Down Expand Up @@ -507,8 +507,8 @@ resource "aws_security_group" "ingress_api" {
vpc_id = aws_vpc.myapp_vpc.id
ingress {
from_port = 3000
to_port = 3000
from_port = 5150
to_port = 5150
protocol = "TCP"
cidr_blocks = ["0.0.0.0/0"]
}
Expand Down
4 changes: 2 additions & 2 deletions docs-site/content/blog/frontend-website.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ environment: development
logger: debug
modes: server
listening on port 3000
listening on port 5150
```

## Creating the Frontend
Expand Down Expand Up @@ -201,5 +201,5 @@ $ docker build . -t loco-todo-list
Now run the container:

```sh
$ docker run -e LOCO_ENV=production -p 3000:3000 loco-todo-list start
$ docker run -e LOCO_ENV=production -p 5150:5150 loco-todo-list start
```
4 changes: 2 additions & 2 deletions docs-site/content/docs/getting-started/axum-users.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ server:

```yaml
server:
port: 3000
port: 5150
```
### Verdict
Expand Down Expand Up @@ -93,7 +93,7 @@ Loco: use your standard `config/[stage].yaml` configuration, and load specific v
# Web server configuration
server:
# Port on which the server will listen. the server binding is 0.0.0.0:{PORT}
port: {{% get_env(name="NODE_PORT", default=3000) %}}
port: {{% get_env(name="NODE_PORT", default=5150) %}}
```

This configuration is strongly typed, contains most-used values like database URL, logger levels and filtering and more. No need to guess or reinvent the wheel.
Expand Down
2 changes: 1 addition & 1 deletion docs-site/content/docs/getting-started/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ It is possible to inject values into a configuration file. In this example, we g
# every configuration file is a valid Tera template
server:
# Port on which the server will listen. the server binding is 0.0.0.0:{PORT}
port: {{/* get_env(name="NODE_PORT", default=3000) */}}
port: {{/* get_env(name="NODE_PORT", default=5150) */}}
# The UI hostname or IP address that mailers will point to.
host: https://localhost
# Out of the box middleware configuration. to disable middleware you can changed the `enable` field to `false` of comment the middleware block
Expand Down
2 changes: 1 addition & 1 deletion docs-site/content/docs/getting-started/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ logger:
```yaml
server:
# Port on which the server will listen. the server binding is 0.0.0.0:{PORT}
port: {{get_env(name="NODE_PORT", default=3000)}}
port: {{get_env(name="NODE_PORT", default=5150)}}
# The UI hostname or IP address that mailers will point to.
host: https://localhost
# Out of the box middleware configuration. to disable middleware you can changed the `enable` field to `false` of comment the middleware block
Expand Down
16 changes: 8 additions & 8 deletions docs-site/content/docs/getting-started/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ cargo loco start
And now, let's see that it's alive:

```sh
$ curl localhost:3000/_ping
$ curl localhost:5150/_ping
{"ok":true}
```

Expand All @@ -156,7 +156,7 @@ The built in `_ping` route will tell your load balancer everything is up.
Let's see that all services that are required are up:

```sh
$ curl localhost:3000/_health
$ curl localhost:5150/_health
{"ok":true}
```

Expand Down Expand Up @@ -211,7 +211,7 @@ cargo loco start
Now, let's test it out:

```sh
$ curl localhost:3000/guide
$ curl localhost:5150/guide
hello
```

Expand Down Expand Up @@ -284,7 +284,7 @@ cargo loco start
And hit `/home/hello`:

```sh
$ curl localhost:3000/home/hello
$ curl localhost:5150/home/hello
ola, mundo
```

Expand Down Expand Up @@ -533,7 +533,7 @@ cargo loco start
And make a request:
```sh
$ curl localhost:3000/articles
$ curl localhost:5150/articles
[{"created_at":"...","updated_at":"...","id":1,"title":"how to build apps in 3 steps","content":"use Loco: https://loco.rs"}]
```
Expand Down Expand Up @@ -643,14 +643,14 @@ Add a new article:
$ curl -X POST -H "Content-Type: application/json" -d '{
"title": "Your Title",
"content": "Your Content xxx"
}' localhost:3000/articles
}' localhost:5150/articles
{"created_at":"...","updated_at":"...","id":2,"title":"Your Title","content":"Your Content xxx"}
```
Get a list:
```sh
$ curl localhost:3000/articles
$ curl localhost:5150/articles
[{"created_at":"...","updated_at":"...","id":1,"title":"how to build apps in 3 steps","content":"use Loco: https://loco.rs"},{"created_at":"...","updated_at":"...","id":2,"title":"Your Title","content":"Your Content xxx"}
```
Expand Down Expand Up @@ -757,7 +757,7 @@ Now let's add a comment to Article `1`:
$ curl -X POST -H "Content-Type: application/json" -d '{
"content": "this rocks",
"article_id": 1
}' localhost:3000/comments
}' localhost:5150/comments
{"created_at":"...","updated_at":"...","id":4,"content":"this rocks","article_id":1}
```
Expand Down
14 changes: 7 additions & 7 deletions docs-site/content/docs/getting-started/tour/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ $ cargo loco start
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
https://loco.rs
listening on port 3000
listening on port 5150
```
<!-- </snip> -->

Expand Down Expand Up @@ -140,7 +140,7 @@ $ cargo loco start
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
https://loco.rs
listening on port 3000
listening on port 5150
```
<!-- </snip> -->
Expand All @@ -150,13 +150,13 @@ Next, try adding a `post` with `curl`:
$ curl -X POST -H "Content-Type: application/json" -d '{
"title": "Your Title",
"content": "Your Content xxx"
}' localhost:3000/posts
}' localhost:5150/posts
```
You can list your posts:
```sh
$ curl localhost:3000/posts
$ curl localhost:5150/posts
```
For those counting -- the commands for creating a blog backend were:
Expand Down Expand Up @@ -200,7 +200,7 @@ $ cargo loco doctor
The `/api/auth/register` endpoint creates a new user in the database with an `email_verification_token` for account verification. A welcome email is sent to the user with a verification link.
```sh
$ curl --location '127.0.0.1:3000/api/auth/register' \
$ curl --location '127.0.0.1:5150/api/auth/register' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Loco user",
Expand All @@ -216,7 +216,7 @@ For security reasons, if the user is already registered, no new user is created,
After registering a new user, use the following request to log in:
```sh
$ curl --location '127.0.0.1:3000/api/auth/login' \
$ curl --location '127.0.0.1:5150/api/auth/login' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "[email protected]",
Expand All @@ -241,7 +241,7 @@ The response includes a JWT token for authentication, user ID, name, and verific
This endpoint is protected by auth middleware.
```sh
$ curl --location --request GET '127.0.0.1:3000/api/user/current' \
$ curl --location --request GET '127.0.0.1:5150/api/user/current' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer TOKEN'
```
Expand Down
16 changes: 8 additions & 8 deletions docs-site/content/docs/the-app/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ The `/api/auth/register` endpoint creates a new user in the database with an `em
##### Example Curl Request:

```sh
curl --location '127.0.0.1:3000/api/auth/register' \
curl --location '127.0.0.1:5150/api/auth/register' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Loco user",
Expand All @@ -70,7 +70,7 @@ After registering a new user, use the following request to log in:
##### Example Curl Request:

```sh
curl --location '127.0.0.1:3000/api/auth/login' \
curl --location '127.0.0.1:5150/api/auth/login' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "[email protected]",
Expand Down Expand Up @@ -101,7 +101,7 @@ Upon user registration, an email with a verification link is sent. Visiting this
#### Example Curl request:

```sh
curl --location '127.0.0.1:3000/api/auth/verify' \
curl --location '127.0.0.1:5150/api/auth/verify' \
--header 'Content-Type: application/json' \
--data '{
"token": "TOKEN"
Expand All @@ -117,7 +117,7 @@ The `forgot` endpoint requires only the user's email in the payload. An email is
##### Example Curl request:

```sh
curl --location '127.0.0.1:3000/api/auth/forgot' \
curl --location '127.0.0.1:5150/api/auth/forgot' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "[email protected]"
Expand All @@ -131,7 +131,7 @@ To reset the password, send the token generated in the `forgot` endpoint along w
##### Example Curl request:

```sh
curl --location '127.0.0.1:3000/api/auth/reset' \
curl --location '127.0.0.1:5150/api/auth/reset' \
--header 'Content-Type: application/json' \
--data '{
"token": "TOKEN",
Expand All @@ -144,7 +144,7 @@ curl --location '127.0.0.1:3000/api/auth/reset' \
This endpoint is protected by auth middleware.

```sh
curl --location --request GET '127.0.0.1:3000/user/current' \
curl --location --request GET '127.0.0.1:5150/user/current' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer TOKEN'
```
Expand Down Expand Up @@ -209,7 +209,7 @@ The `/api/auth/register` endpoint creates a new user in the database with an `ap
#### Example Curl Request:

```sh
curl --location '127.0.0.1:3000/api/auth/register' \
curl --location '127.0.0.1:5150/api/auth/register' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Loco user",
Expand Down Expand Up @@ -252,7 +252,7 @@ To request an authenticated endpoint, you need to pass the `API_KEY` in the `Aut
#### Example Curl Request:

```sh
curl --location '127.0.0.1:3000/api/user/current-api' \
curl --location '127.0.0.1:5150/api/user/current-api' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer API_KEY'
```
Expand Down
2 changes: 1 addition & 1 deletion examples/demo/config/development.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ logger:
# <snip id="configuration-server">
server:
# Port on which the server will listen. the server binding is 0.0.0.0:{PORT}
port: {{get_env(name="NODE_PORT", default=3000)}}
port: {{get_env(name="NODE_PORT", default=5150)}}
# The UI hostname or IP address that mailers will point to.
host: https://localhost
# Out of the box middleware configuration. to disable middleware you can changed the `enable` field to `false` of comment the middleware block
Expand Down
2 changes: 1 addition & 1 deletion examples/demo/config/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ logger:
# Web server configuration
server:
# Port on which the server will listen. the server binding is 0.0.0.0:{PORT}
port: 3000
port: 5150
# The UI hostname or IP address that mailers will point to.
host: https://localhost
# Out of the box middleware configuration. to disable middleware you can changed the `enable` field to `false` of comment the middleware block
Expand Down
2 changes: 1 addition & 1 deletion examples/demo/config/teste2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ logger:
# Web server configuration
server:
# Port on which the server will listen. the server binding is 0.0.0.0:{PORT}
port: 3000
port: 5150
# The UI hostname or IP address that mailers will point to.
host: https://localhost
# Out of the box middleware configuration. to disable middleware you can changed the `enable` field to `false` of comment the middleware block
Expand Down
2 changes: 1 addition & 1 deletion examples/demo/src/controllers/upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::views;
/// ## Request Example
///
/// curl -H "Content-Type: multipart/form-data" -F "file=@./test-2.json"
/// 127.0.0.1:3000/upload/file
/// 127.0.0.1:5150/upload/file
async fn upload_file(State(ctx): State<AppContext>, mut multipart: Multipart) -> Result<Response> {
let mut file = None;
while let Some(field) = multipart.next_field().await.map_err(|err| {
Expand Down
4 changes: 2 additions & 2 deletions examples/llm-candle-inference/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ It may download a large model file, and will take some more time to prepare and
Next, try your first inference request and wait for the tokens to start streaming:

```sh
$ curl -vvv --no-buffer localhost:3000/candle-llm
$ curl -vvv --no-buffer localhost:5150/candle-llm
```

### Adding a global state for your controllers
Expand Down Expand Up @@ -86,7 +86,7 @@ controller/app_routes.rs:203: [Middleware] Adding log trace id
▀▀▀██▄ ▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀ ██▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
started on port 3000
started on port 5150
```

## Getting help
Expand Down
2 changes: 1 addition & 1 deletion examples/llm-candle-inference/config/development.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ logger:
# Web server configuration
server:
# Port on which the server will listen. the server binding is 0.0.0.0:{PORT}
port: 3000
port: 5150
# The UI hostname or IP address that mailers will point to.
host: https://localhost
# Out of the box middleware configuration. to disable middleware you can changed the `enable` field to `false` of comment the middleware block
Expand Down
Loading

0 comments on commit 33b334f

Please sign in to comment.