Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

monograph: add health check endpoint

Abdullah Atta6dd939af5bd8
diff --git a/apps/monograph/app/routes/$id.tsx b/apps/monograph/app/routes/$id.tsx
index 1ebfc95b0..ec491e8f1 100644
--- a/apps/monograph/app/routes/$id.tsx
+++ b/apps/monograph/app/routes/$id.tsx
@@ -44,7 +44,7 @@ type Monograph = {
type MonographResponse = Omit<Monograph, "content"> & { content: string };
export const meta: MetaFunction<typeof loader> = ({ data }) => {
- const imageUrl = `${PUBLIC_URL}/og.png?${new URLSearchParams({
+ const imageUrl = `${PUBLIC_URL}/api/og.png?${new URLSearchParams({
title: data?.metadata?.title || "",
description: Buffer.from(
data?.metadata?.fullDescription || "",
diff --git a/apps/monograph/app/routes/api.health.ts b/apps/monograph/app/routes/api.health.ts
new file mode 100644
index 000000000..c441b4f7f
--- /dev/null
+++ b/apps/monograph/app/routes/api.health.ts
@@ -0,0 +1,27 @@
+/*
+This file is part of the Notesnook project (https://notesnook.com/)
+
+Copyright (C) 2023 Streetwriters (Private) Limited
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+export async function loader() {
+ return new Response("Healthy", {
+ status: 200,
+ headers: {
+ "Content-Type": "text/plain"
+ }
+ });
+}
diff --git a/apps/monograph/app/routes/og[.png].ts b/apps/monograph/app/routes/api.og[.png].ts
similarity index 100%
rename from apps/monograph/app/routes/og[.png].ts
rename to apps/monograph/app/routes/api.og[.png].ts
diff --git a/apps/monograph/package-lock.json b/apps/monograph/package-lock.json
index 63dccbda5..c08bbb3dc 100644
--- a/apps/monograph/package-lock.json
+++ b/apps/monograph/package-lock.json
@@ -136,6 +136,7 @@
"license": "GPL-3.0-or-later",
"dependencies": {
"@notesnook/common": "file:../common",
+ "@notesnook/intl": "file:../intl",
"@notesnook/theme": "file:../theme",
"@notesnook/ui": "file:../ui",
"@social-embed/lib": "^0.1.0-next.7",
diff --git a/apps/monograph/vite.config.ts b/apps/monograph/vite.config.ts
index 98ea1495f..9f36ae7e6 100644
--- a/apps/monograph/vite.config.ts
+++ b/apps/monograph/vite.config.ts
@@ -74,7 +74,7 @@ export default defineConfig({
}
},
ssr: {
- noExternal: true,
+ ...(process.env.NODE_ENV === "development" ? {} : { noExternal: true }),
target: "node"
},
build: {