sørvør
extremely fast, zero config server for modern web applications.
Note: sørvør is under heavy development and might not be ready for production.
That said, I am actively working on project and expect it to be stable soon.
✨ Features
- Flexible EntryPoints - use HTML, CSS or JS as entry point for your application.
- SPA Routing - redirects path requests to HTML entry point for frontend routing.
- Asset Pipeline - great asset processing with simple primitives.
- Live Reloading - live reload browsers on code change.
- Bundle Libraries - bundle libraries for distribution using JS/TS/JSX/TSX entry points.
- Secure Server - Supports https with trusted self signed certificates.
💪 Powered By
- esbuild - an extremely fast JavaScript bundler.
- golang - an expressive, concise, clean, and efficient programming language.
⚡ Installation
Use go binaries to install sørvør:
curl -sf https://gobinaries.com/osdevisnot/sorvor | sh
Or, use npm to install sørvør:
npm install sorvor
Alternatively, if you have go installed, use go get
to install sørvør:
go get github.com/osdevisnot/sorvor
🍽 Usage
You can use sørvør
as a local development server or as a build tool for your applications and/or NPM libraries.
Live Reloading Server
To serve an application using a live reloading server, use HTML as entrypoint and --serve
command line argument.
For example:
sorvor public/index.html --serve
Build Applications for Production
Alternatively, you can build your application with sørvør
using HTML as entrypoint. For Example:
sorvor public/undex.html
Bundle NPM Library
You can also bundle your library for distribution on NPM using a JS entrypoint. For example:
sorvor src/index.js
Example Projects
Check out the example projects for fully integrated setup.
😎 Asset Pipeline
sørvør
provides great asset pipeline with simple primitives.
Build JS or CSS with esbuild
To run entry points from public/index.html
through esbuild, use esbuild
function in the index file
Example:
<script type="module" src="{{ esbuild "index.js" }}"></script>
This will bundle index.js
file and serve the build output on local development server.
Enable Livereload
To enable livereload functionality, use livereload
function in the index file
Example:
{{ livereload }}
💢 Configuration
For most part, sørvør
tries to use sensible defaults, but you can configure the behaviour using command line arguments below:
cli argument |
description |
default value |
--host=... |
host for sørvør |
localhost |
--port=... |
port for sørvør |
1234 |
--serve |
enable development mode |
false |
--secure |
use https in dev mode |
false |
sørvør
forwards all the other command line arguments to esbuild
.
Note: --secure
automatically creates a self signed certificate for provided host.
to disable chrome warnings, open chrome://flags/#allow-insecure-localhost and change the setting to "Enabled".
Please refer documentation for simple esbuild options or advance options to further customize the bundling process.
sørvør
configures below values for esbuild as defaults:
cli argument |
description |
default value |
--bundle |
enables bundling output files |
true |
--write |
enables writing built output to disk |
true |
--outdir=... |
target directory for esbuild output |
dist |
🐣 Motivations/Inspirations
sørvør
started with desire to simplify frontend tooling, with strong focus on speed of execution. It uses esbuild
for bundling modern javascript and typescript syntax to a lower target. The idea here is to implement features that esbuild
deems as out of scope, but are necessary for a decent development environment.
This project is inspired by servør from Luke Jackson, which provides similar zero dependency development experience but lacks integration with bundler/build tools. I chose golang to implement this project to solidify my learning of the language and to achieve a zero dependency model.
🔬 Roadmap
This project currently lacks some extended features available in servør, some of which will be implemented in the future.
I also want to avoid implementing features that are already on the roadmap for esbuild
. The idea is to use esbuild as is without duplicating efforts.
🥂 License
sørvør is licensed under the MIT License.
Documentation is licensed under Creative Commons License.
Created with ❤️ by @osdevisnot and all contributors.