Skip to content

Commit

Permalink
Merge pull request #88 from edgio-docs/COMSUP-116_astro
Browse files Browse the repository at this point in the history
[COMSUP-116] Latest Astro support
  • Loading branch information
Tristan Lee authored Feb 2, 2024
2 parents 21931c0 + a57b26c commit e0c737b
Show file tree
Hide file tree
Showing 9 changed files with 14,551 additions and 26,538 deletions.
2 changes: 0 additions & 2 deletions examples/v7-astro/.github/workflows/edgio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: if [ -f yarn.lock ]; then yarn install; else npm ci; fi
- run: if [ -f yarn.lock ]; then yarn edgio:deploy -- --token=$EDGIO_DEPLOY_TOKEN; else npm run edgio:deploy -- --token=$EDGIO_DEPLOY_TOKEN; fi
env:
Expand Down
14 changes: 7 additions & 7 deletions examples/v7-astro/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ npm run edgio:deploy

---

## Astro Starter Kit: Basics
# Astro Starter Kit: Basics

```
```sh
npm create astro@latest -- --template basics
```

Expand All @@ -44,11 +44,11 @@ npm create astro@latest -- --template basics
![just-the-basics](https://github.com/withastro/astro/assets/2244813/a0a5533c-a856-4198-8470-2d67b1d7c554)

### 🚀 Project Structure
## 🚀 Project Structure

Inside of your Astro project, you'll see the following folders and files:

```
```text
/
├── public/
│ └── favicon.svg
Expand All @@ -68,19 +68,19 @@ There's nothing special about `src/components/`, but that's where we like to put

Any static assets, like images, can be placed in the `public/` directory.

### 🧞 Commands
## 🧞 Commands

All commands are run from the root of the project, from a terminal:

| 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` |
| `npm run astro -- --help` | Get help using the Astro CLI |

### 👀 Want to learn more?
## 👀 Want to learn more?

Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
9 changes: 1 addition & 8 deletions examples/v7-astro/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
import { defineConfig } from 'astro/config';

import node from "@astrojs/node";

// https://astro.build/config
export default defineConfig({
output: "server",
adapter: node({
mode: "standalone"
})
});
export default defineConfig({});
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
// This file was automatically added by edgio init.
// You should commit this file to source control.
// Learn more about this file at https://docs.edg.io/guides/edgio_config
const { join } = require('path');

module.exports = {
connector: '@edgio/astro',

// The name of the site in Edgio to which this app should be deployed.
// name: 'my-site-name',

// The name of the team in Edgio to which this app should be deployed.
// team: 'my-team-name',
// The name of the organization in Edgio to which this app should be deployed.
// organization: 'my-organization-name',

// Overrides the default path to the routes file. The path should be relative to the root of your app.
// routes: 'routes.js',

astro: {
// The path of the standalone server that runs Astro SSR
// The dependencies for this file are automatically bundled
appPath: join(process.cwd(), 'dist', 'server', 'entry.mjs'),
// appPath: join('dist', 'server', 'entry.mjs')
},

// When set to true or omitted entirely, Edgio includes the deployment number in the cache key,
// effectively purging the cache each time you deploy.
// purgeCacheOnDeploy: false,

// If you need to proxy some URLs to an origin instead of your Next.js app, you can configure the origins here:
// origins: [
// {
Expand All @@ -29,13 +31,13 @@ module.exports = {
//
// // When provided, the following value will be sent as the host header when connecting to the origin.
// // If omitted, the host header from the browser will be forwarded to the origin.
// override_host_header: "example.com",
// override_host_header: "test-origin.edgio.net",
//
// // The list of backend hosts
// hosts: [
// {
// // The domain name or IP address of the origin server
// location: "example.com"
// location: "test-origin.edgio.net"
// }
// ]
// }
Expand All @@ -46,10 +48,10 @@ module.exports = {
// // Set to true to include all packages listed in the dependencies property of package.json when deploying to Edgio.
// // This option generally isn't needed as Edgio automatically includes all modules imported by your code in the bundle that
// // is uploaded during deployment
// includeNodeModules: true,
// // includeNodeModules: true,
//
// // Include additional paths that are dynamically loaded by your app at runtime here when building the serverless bundle.
// include: ['views/**/*'],
// // include: ['views/**/*'],
// },

// The maximum number of URLs that will be concurrently prerendered during deployment when static prerendering is enabled.
Expand Down
Loading

0 comments on commit e0c737b

Please sign in to comment.