DEV Community

Cover image for A small, self-contained, cross-platform web server for development
Volker Schukai
Volker Schukai

Posted on

A small, self-contained, cross-platform web server for development

In addition to researching and reading, I also wrote some code on a rainy sunday.

A small development web server with the ability to monitor file changes and call external tools.

Here you can download the binary for Linux and Windows.


I have named it conan - the little wolf.

little wolf


In the video you can see how the autoload function works. At the bottom left I start the web server. Once with a command line option and once with a configuration file.

In the upper right corner I make changes which are then automatically displayed without having to manually reload the browser.


A simple configuration file config.yaml can be used to specify not only the standards such as the host and the port, but also the directories and files to be monitored.

The command is then executed when changes are made.

The keys are intuitive.

Server:

  # Host: localhost:8080
  # Address: localhost
  # Port: 8080

  Path:
    Web: web

  Watch:
    - Path: .
      Command: esbuild --bundle --outfile={{ .WebPath }}/bundle.js --sourcemap
      Exclude:
        - ~$
        - ^\.

  Flags:
    FollowSymlinks: true

Enter fullscreen mode Exit fullscreen mode

The programme is then started:

conan --config=config.yaml server serve
Enter fullscreen mode Exit fullscreen mode

That's it!


Top comments (0)