Creating a Local Deployment of Obsidian Digital Garden - Github discussion

About

#Omnivore

Read on Omnivore
Read Original

Github discussion demonstrating how to set up a local deployment of Obsidian Digital Garden

This page is powered by Omnivore ‐ you can read more about how I use Omnivore here: Omnivore - Saving Articles for Citations in Obsidian.

Highlights

I threw something together you could use to run this locally:

  1. Clone your digital garden repo to your computer
  2. run npm install express --save to install express as a dependency.
  3. Create a new file in the root folder called app.js, and paste the following code:

const express = require('express')
const app = express()
const port = 8080;

const searchHandler = require('./netlify/functions/search/search.js').handler;

app.get('/api/search', async (req, res) => {
//Mock the netlify event
let event = {queryStringParameters: req.query};

let response = await searchHandler(event);
res.status(response.statusCode).send(response.body);
})

app.use(express.static('dist'))

app.get('*', (req, res)=>{
res.redirect("/404")
})

app.listen(port, () => {
console.log(Digital garden running on port ${port})
})

  1. Run npm install
  2. Run npm run build
  3. Run node app.js

The site should now be available at localhost:8080.

You can then use something like pm2 to run it on your server, and use a reverse nginx proxy with lets encrypt to expose it on port 443 with https. ⤴️

Method for creating a local deployment of #obsidian-digital-garden