Skip to content

Commit

Permalink
Add the output option (#4015)
Browse files Browse the repository at this point in the history
* Start of work on astroConfig.mode === 'server'

* Add tests and more

* adapter -> deploy in some places

* Add fallback for `adapter` config

* Update more tests

* Update image tests

* Fix clientAddress test

* Updates based on PR review

* Add a changeset

* Update integrations tests + readme

* Oops

* Remove old option

* Rename `mode` to `output`

* Update Node adapter test

* Update test

* fred pass

* fred pass

* fred pass

* fix test

Co-authored-by: Fred K. Schott <[email protected]>
  • Loading branch information
matthewp and FredKSchott authored Jul 25, 2022
1 parent 3f716db commit 42da2e2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/integrations/node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import node from '@astrojs/node';

export default defineConfig({
// ...
output: 'server',
adapter: node()
})
```
Expand Down
6 changes: 5 additions & 1 deletion packages/integrations/node/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ export default function createIntegration(): AstroIntegration {
return {
name: '@astrojs/node',
hooks: {
'astro:config:done': ({ setAdapter }) => {
'astro:config:done': ({ setAdapter, config }) => {
setAdapter(getAdapter());

if(config.output === 'static') {
console.warn(`[@astrojs/Node] \`output: "server"\` is required to use this adapter.`);
}
},
},
};
Expand Down
4 changes: 1 addition & 3 deletions packages/integrations/node/test/api-route.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ describe('API routes', () => {
before(async () => {
fixture = await loadFixture({
root: './fixtures/api-route/',
experimental: {
ssr: true,
},
output: 'server',
adapter: nodejs(),
});
await fixture.build();
Expand Down

0 comments on commit 42da2e2

Please sign in to comment.