Compare commits

...

5 Commits

Author SHA1 Message Date
Ryan Zhu 022c88e1b9
Merge 4f2b29f8ab into 94d6ebf772 2025-04-04 22:30:33 +02:00
TheHandyOwl 94d6ebf772
NEW: updating linux.es.md and macos.es.md texts #1072 (#1074) 2025-03-28 22:59:52 +01:00
Patrick Killian 1a31253d31
Fix "Model Coupling" example in Schema docs (#1073)
Amends the `UserNameMigration` code example in the "Model Coupling"
section of the Schema documentation with correct syntax. Added closing
square brackets to the dictionary literals passed into
`QueryBuilder.set(_ data:)` in multiple places.
2025-03-25 10:22:49 +01:00
Ryan Zhu 4f2b29f8ab
Update zeabur.md 2024-01-28 13:50:27 +08:00
Ryan Zhu 0d4c553d15
Create zeabur.md 2024-01-25 17:06:08 +08:00
5 changed files with 99 additions and 10 deletions

51
docs/deploy/zeabur.md Normal file
View File

@ -0,0 +1,51 @@
## What is Zeabur
[Zeabur](https://zeabur.com) is a platform that helps you deploy your service with one click, No matter what programming language or framework you use.
## Signing Up
You need a Zeabur account. If you don't have one, please use the following link to create:
</br>
https://zeabur.com/zh-TW/login
Zeabur uses "Login with GitHub" and needs access to your GitHub repos. You could change its access to your different projects and organizations later.
## Upload Your Project to GitHub
Before you deploy your Vapor project, you need to upload it to GitHub. Zeabur connects to your GitHub account, and you can select your public or private repo to deploy on Zeabur's Dashboard.
### Remove Docker File
The project created by the Vapor command has Dockerfile and docker-compose.yml by default. To avoid being recognized as the Docker Container by Zeabur, you need to delete these two files:
```bash
rm Dockerfile docker-compose.yml
```
### Sync Your Files
Make sure that all your changes have been synchronized to GitHub:
```bash
git add .
git commit -m "your commit message"
git push
```
## Deployment
Go to [Zeabur Console](https://dash.zeabur.com) and create a new project.
Then, click the `Deploy New Service` button and select deploy from GitHub.
After you select the repository and branch, Zeabur will automatically start building your service.
Zeabur will automatically detect that your service is built by Vapor, so you don't need to do any additional configuration. Your deployment will be completed in a few minutes.
## Next
After the deployment is completed, you may need to configure the domain for your Vapor website.
Open the "Domain" tab of the service page, and then click "Generate Domain" or "Custom Domain".
For more information on how to bind a domain to your service, please refer to Zeabur's Docs on [Domain Binding](https://zeabur.com/docs/deploy/domain-binding).

View File

@ -390,7 +390,7 @@ struct UserNameMigration: AsyncMigration {
// Esto tampoco intenta dividir el nombre en nombre y apellido,
// ya que eso requiere sintaxis específica de la base de datos.
try await User.query(on: database)
.set(["first_name": .sql(embed: "name"))
.set(["first_name": .sql(embed: "name")])
.run()
try await database.schema("users")
@ -403,7 +403,7 @@ struct UserNameMigration: AsyncMigration {
.field("name", .string, .required)
.update()
try await User.query(on: database)
.set(["name": .sql(embed: "concat(first_name, ' ', last_name)"))
.set(["name": .sql(embed: "concat(first_name, ' ', last_name)")])
.run()
try await database.schema("users")
.deleteField("first_name")

View File

@ -390,7 +390,7 @@ struct UserNameMigration: AsyncMigration {
// This also doesn't try to deal with splitting the name into first and last,
// as that requires database-specific syntax.
try await User.query(on: database)
.set(["first_name": .sql(embed: "name"))
.set(["first_name": .sql(embed: "name")])
.run()
try await database.schema("users")
@ -403,7 +403,7 @@ struct UserNameMigration: AsyncMigration {
.field("name", .string, .required)
.update()
try await User.query(on: database)
.set(["name": .sql(embed: "concat(first_name, ' ', last_name)"))
.set(["name": .sql(embed: "concat(first_name, ' ', last_name)")])
.run()
try await database.schema("users")
.deleteField("first_name")

View File

@ -51,9 +51,27 @@ También puedes usar las imágenes de Docker oficiales de Swift que vienen con e
## Instalar Toolbox
Ahora que tienes Swift instalado, vamos a instalar [Vapor Toolbox](https://github.com/vapor/toolbox). Esta aplicación de línea de comando (CLI) no es necesaria para usar Vapor, pero incluye útiles herramientas.
Ahora que tienes Swift instalado, vamos a instalar [Vapor Toolbox](https://github.com/vapor/toolbox). Esta aplicación de línea de comando (CLI) no es necesaria para usar Vapor, pero ayuda a crear nuevos proyectos Vapor.
En Linux deberás compilar Toolbox desde el código fuente. Puedes ver las <a href="https://github.com/vapor/toolbox/releases" target="_blank">versiones</a> de Toolbox en GitHub para encontrar la versión más reciente.
### Homebrew
La Toolbox se distribuye a través de Homebrew. Si aún no tienes Homebrew, visita <a href="https://brew.sh" target="_blank">brew.sh</a> para instrucciones de instalación.
```sh
brew install vapor
```
Verifica que la instalación se ha realizado correctamente imprimiendo la ayuda.
```sh
vapor --help
```
Deberías ver una lista de comandos disponibles.
### Makefile
Si quieres, también puedes compilar la Toolbox desde el código fuente. Consulta las <a href="https://github.com/vapor/toolbox/releases" target="_blank">versiones</a> de la Toolbox en GitHub para encontrar la versión más reciente.
```sh
git clone https://github.com/vapor/toolbox.git
@ -72,4 +90,4 @@ Deberías ver una lista de comandos disponibles.
## Siguientes Pasos
Después de instalar Swift, crea tu primera app en [Comenzando &rarr; Hola, mundo](../getting-started/hello-world.md).
Ahora que tienes instalados Swift y Vapor Toolbox, crea tu primera app en [Comenzando &rarr; Hola, mundo](../getting-started/hello-world.md).

View File

@ -27,14 +27,35 @@ Vapor 4 requiere Swift 5.9 o superior.
## Instalar Toolbox
Ahora que tienes Swift instalado, vamos a instalar [Vapor Toolbox](https://github.com/vapor/toolbox). Esta aplicación de línea de comando (CLI) no es necesaria para usar Vapor, pero incluye útiles herramientas como un nuevo creador de proyectos.
Ahora que tienes Swift instalado, vamos a instalar [Vapor Toolbox](https://github.com/vapor/toolbox). Esta aplicación de línea de comando (CLI) no es necesaria para usar Vapor, pero ayuda a crear nuevos proyectos Vapor.
Toolbox se distribuye a través de Homebrew. Si aún no tienes Homebrew, visita <a href="https://brew.sh" target="_blank">brew.sh</a> para obtener instrucciones de instalación.
### Homebrew
Toolbox se distribuye a través de Homebrew. Si aún no tienes Homebrew, visita <a href="https://brew.sh" target="_blank">brew.sh</a> para instrucciones de instalación.
```sh
brew install vapor
```
Verifica que la instalación se ha realizado correctamente imprimiendo la ayuda.
```sh
vapor --help
```
Deberías ver una lista de comandos disponibles.
### Makefile
Si quieres, también puedes compilar la Toolbox desde el código fuente. Consulta las <a href="https://github.com/vapor/toolbox/releases" target="_blank">versiones</a> de la Toolbox en GitHub para encontrar la versión más reciente.
```sh
git clone https://github.com/vapor/toolbox.git
cd toolbox
git checkout <desired version>
make install
```
Verifica que la instalación fue exitosa imprimiendo la ayuda.
```sh
@ -43,7 +64,6 @@ vapor --help
Deberías ver una lista de comandos disponibles.
## Siguientes Pasos
Ahora que tienes instalados Swift y Vapor Toolbox, crea tu primera app en [Comenzando &rarr; Hola, mundo](../getting-started/hello-world.md).