-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from zernonia/add-unofficial-notion-client-pac…
…kage update nuxt demo, add notion-client endpoint
- Loading branch information
Showing
7 changed files
with
1,681 additions
and
964 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<script setup lang="ts"></script> | ||
|
||
<template> | ||
<NuxtChild></NuxtChild> | ||
<NuxtPage></NuxtPage> | ||
</template> | ||
|
||
<style> | ||
|
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,10 +1,10 @@ | ||
import { defineNuxtConfig } from "nuxt" | ||
|
||
export default defineNuxtConfig({ | ||
meta: { | ||
title: "Nuxt3 Notion", | ||
meta: [{ charset: "utf-8" }, { name: "viewport", content: "width=device-width, initial-scale=1" }], | ||
link: [{ rel: "icon", type: "image/png", href: "/logo.png" }], | ||
app: { | ||
head: { | ||
title: "Nuxt3 Notion", | ||
meta: [{ charset: "utf-8" }, { name: "viewport", content: "width=device-width, initial-scale=1" }], | ||
link: [{ rel: "icon", type: "image/png", href: "/logo.png" }], | ||
}, | ||
}, | ||
modules: [["vue3-notion/nuxt", { css: true }]], | ||
}) | ||
}); |
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,10 @@ | ||
import { NotionAPI } from "notion-client"; | ||
|
||
export default defineEventHandler(async (event) => { | ||
const pageId = event.context.params.pageId; | ||
|
||
const api = new NotionAPI(); | ||
const page = await api.getPage(pageId.toString()); | ||
|
||
return page; | ||
}); |
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,3 @@ | ||
import type { IncomingMessage, ServerResponse } from "http" | ||
|
||
export default (_req: IncomingMessage, res: ServerResponse, next: () => void) => { | ||
// cache for 2 mins (120 seconds) | ||
res.setHeader("Cache-Control", "s-maxage=120, stale-while-revalidate") | ||
next() | ||
} | ||
export default defineEventHandler((event) => { | ||
event.res.setHeader("Cache-Control", "s-maxage=120, stale-while-revalidate"); | ||
}); |
Large diffs are not rendered by default.
Oops, something went wrong.
3d4cbfe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
vue3-notion-preview – ./
vue3-notion-preview-zernonia.vercel.app
vue3-notion-preview.vercel.app
vue3-notion-preview-git-master-zernonia.vercel.app
3d4cbfe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
vue3-notion – ./demo/nuxt
vue3-notion.vercel.app
vue3-notion-zernonia.vercel.app
vue3-notion-git-master-zernonia.vercel.app