-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
495 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
"use server" | ||
|
||
interface SiteAccessValues { | ||
url: string, | ||
username: string, | ||
appPassword: string, | ||
} | ||
|
||
export const SiteInfo = async (values: SiteAccessValues) => { | ||
|
||
console.log(values, "<-- values from SiteInfo") | ||
const wpApiHost = `${values.url}/wp-json/wp/v2` | ||
console.log(wpApiHost, "<-- wpApiHost") | ||
|
||
// WP API Pages Endpoint | ||
const response = await fetch(`${wpApiHost}/pages`, { | ||
headers: { | ||
"Content-Type": "application/json", | ||
"Authorization": `Basic ${btoa(`${values.username}:${values.appPassword}`)}` | ||
} | ||
}) | ||
|
||
const data = await response.json(); | ||
const headers = response.headers; | ||
|
||
return { data, headers }; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import Anthropic from '@anthropic-ai/sdk'; | ||
|
||
export const anthropic = new Anthropic({ | ||
apiKey: process.env.ANTHROPIC_API_KEY!, | ||
}); |
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
Oops, something went wrong.