mirror of
https://github.com/withastro/astro.git
synced 2025-03-10 23:01:26 -05:00
Add the output
option (#4015)
* 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 <fkschott@gmail.com>
This commit is contained in:
parent
3f716dba24
commit
42da2e23eb
3 changed files with 7 additions and 4 deletions
|
@ -37,6 +37,7 @@ import node from '@astrojs/node';
|
|||
|
||||
export default defineConfig({
|
||||
// ...
|
||||
output: 'server',
|
||||
adapter: node()
|
||||
})
|
||||
```
|
||||
|
|
|
@ -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.`);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue