-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enhancement/issue 955 support multiple custom page formats at once (#…
…1265) * support multiple custom page formats at once * add test cases for custom API routes page format
- Loading branch information
1 parent
24fa5f5
commit 1205b86
Showing
5 changed files
with
106 additions
and
22 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
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
13 changes: 13 additions & 0 deletions
13
packages/cli/test/cases/loaders-build.plugins.resource-page/src/pages/api/greeting.bar
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,13 @@ | ||
interface User { } | ||
|
||
export async function handler(request) { | ||
const params = new URLSearchParams(request.url.slice(request.url.indexOf('?'))); | ||
const name = params.has('name') ? params.get('name') : 'World'; | ||
const body = { message: `Hello ${name}!!!` }; | ||
|
||
return new Response(JSON.stringify(body), { | ||
headers: new Headers({ | ||
'Content-Type': 'application/json' | ||
}) | ||
}); | ||
} |
6 changes: 5 additions & 1 deletion
6
...s-build.plugins.resource-page/contact.bar → ...ugins.resource-page/src/pages/contact.bar
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,7 +1,11 @@ | ||
interface User { } | ||
|
||
export default class ContactPage extends HTMLElement { | ||
connectedCallback() { | ||
this.innerHTML = ` | ||
<h1>Welcome to our Contact page!</h1> | ||
`; | ||
} | ||
} | ||
} | ||
|
||
export const prerender = true; |