From 898c9015f157ee599a1fb17d82a52f1bd94ca4b6 Mon Sep 17 00:00:00 2001 From: Tomasz Pluskiewicz Date: Tue, 20 Aug 2024 13:10:30 +0200 Subject: [PATCH] docs: express --- .../kopflos/how-to/web-server-libraries.md | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 docs/apis/kopflos/how-to/web-server-libraries.md diff --git a/docs/apis/kopflos/how-to/web-server-libraries.md b/docs/apis/kopflos/how-to/web-server-libraries.md new file mode 100644 index 0000000..58bfb7c --- /dev/null +++ b/docs/apis/kopflos/how-to/web-server-libraries.md @@ -0,0 +1,25 @@ +# Integrate with web server libraries + +All libraries integrated with Kopflos require the same configuration, at the very least the SPARQL endpoint URL and the API graph URL(s). + +## Express + +```ts +import express from 'express' +import kopflos from '@kopflos-cms/express' + +const app = express() + +app.use(kopflos({ + sparql: { + default: 'http://localhost:3030/ds/query', + }, + apiGraphs: [ + 'https://example.com/api', + ] +})) + +app.listen(3000, () => { + console.log('Server is running on http://localhost:3000') +}) +```