Skip to content

Java-Idl/LocalServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LocalServer

LocalServer is a Windows Go server that serves local HTML files, provides a built-in HTML editor at /, and syncs discovered pages into the Obsidian canvas file at C:\Users\java\Documents\Obsidian Vault\BOARDS\LocalServer.canvas.

What it does

  • Serves local files from C:\LocalServer
  • Opens the HTML editor on the home page
  • Accepts pasted HTML or dropped .html files
  • Saves files with either a user-supplied name or a generated random name
  • Adds saved pages to the canvas automatically

Run

Build and run the server:

cd C:\LocalServer
go build -o canvas_server.exe main.go
.\canvas_server.exe

The server listens on port 8888.

Editor

Open:

http://localhost:8888/

You can paste raw HTML into the editor or drag and drop an .html file.

Saving HTML

  • Enter a custom filename, or leave it blank to generate a random name.
  • The .html extension is added automatically when needed.
  • Saved files are written to C:\LocalServer.

Windows Service with NSSM

To run it in the background and autostart with Windows, use NSSM.

  1. Download NSSM and place nssm.exe somewhere on your PATH, or use the full path.
  2. Install the service:
nssm install LocalServer "C:\LocalServer\canvas_server.exe"
  1. Set the service to start automatically if needed:
nssm set LocalServer Start SERVICE_AUTO_START
  1. Start it:
net start LocalServer
  1. Stop it:
net stop LocalServer

Notes

  • The editor route is internal and is not scanned into the canvas.
  • If you want the server to restart after changes, rebuild canvas_server.exe and restart the service.

About

A Go server that hosts local HTML files and automatically syncs them as cards into an Obsidian canvas file.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages