-
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docs): improve Deployments and Static Files docs (#738)
- Loading branch information
Showing
9 changed files
with
92 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@lagon/docs': patch | ||
--- | ||
|
||
Improve Deployments docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@lagon/docs': patch | ||
--- | ||
|
||
Rename Static Files to Assets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
{ | ||
"deployments": "Deployments", | ||
"logs": "Logs", | ||
"assets": "Assets", | ||
"environment-variables": "Environment variables", | ||
"cron": "Cron", | ||
"static-files": "Static files", | ||
"domains": "Domains", | ||
"logs": "Logs", | ||
"cron": "Cron", | ||
"pricing": "Pricing", | ||
"limits": "Limits", | ||
"regions": "Regions", | ||
"limits": "Limits", | ||
"security": "Security" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
Lagon can host and serve assets such as images, CSS files, and JavaScript files. These assets are static files that are not generated dynamically by your Function. | ||
|
||
When deploying a Function, you can specify an assets directory using the [`--public` or `-p`](/cli#lagon-deploy) flag. This directory will be served by Lagon at the root of your Function's URL. | ||
|
||
## Automatic assets serving | ||
|
||
Let's say you have a Function inside an `index.ts` file, with a favicon and an image: | ||
|
||
``` | ||
index.ts | ||
public/ | ||
favicon.ico | ||
images/ | ||
image.png | ||
``` | ||
|
||
To deploy this Function with these asets, you can use the `-p` or `--public` flag: | ||
|
||
```bash | ||
lagon deploy ./index.ts --public public | ||
# Same as | ||
lagon deploy ./index.ts -p public | ||
``` | ||
|
||
Your Function is now deployed to `example.lagon.dev`. You can access the favicon and the image at the following URLs: | ||
|
||
- `example.lagon.dev/favicon.ico` | ||
- `example.lagon.dev/images/image.png` | ||
|
||
In your HTML, you can reference these files using relative paths: | ||
|
||
```html | ||
<link rel="icon" href="/favicon.ico" /> | ||
<!-- ... --> | ||
<img src="/images/image.png" /> | ||
``` | ||
|
||
## Limits | ||
|
||
The number and size of assets are limited to prevent abuses. [Learn more about the assets limits](/cloud/limits). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78c3787
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deployment failed with the following error: