Skip to content

bohjak/hotserve

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hotserve

A lightweight C99 HTTP/1.1 server.

Functionality

  • Serve a directory
  • Watch the served directory and reload the served page on file change

Help

Usage: hotserve [OPTIONS] <DIRECTORY>

A minimal HTTP/1.1 server with development utiliites, such as source file watcher and SSE triggered page reload.

Options:
   -watch    Reloads the served page when any files in the served directory change
   -port <N> Port number to listen at (default: 8080)"
   -help     Prints this help message

Development

Build only tested on linux. Targets C99 libc with 1993 POSIX extensions.

To build, run ./build.sh

Available arguments for the script (through env vars):

  • RELEASE: toggles between release and debug builds (default: 0)
  • WERR: enables -Werror compiler flag (default: 1)
  • NO_CLR: disables deleting the build directory before building (default: 0)
  • RUN: when enabled, automatically runs the binary with gdb after build (default: 0)
  • ENTRY: build entrypoint - assumes unity build (default: "src/entry_linux_cli.c")
  • OUT_BIN: name of the built binary (default: "out")
  • CC: compiler to be used (default: "clang -DCOMPILER_CLANG")

About

Minimal HTTP/1.1 server with source file watcher and SSE triggered page reload

Resources

Stars

Watchers

Forks

Contributors