Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dchest/comboserver

Comboserver serves multiple files combined in a single request.
https://github.com/dchest/comboserver

Last synced: about 1 month ago
JSON representation

Comboserver serves multiple files combined in a single request.

Awesome Lists containing this project

README

        

Comboserver serves multiple files combined in a single request.

INSTALLATION

From source with Go 1.1+:

$ go get http://github.com/dchest/comboserver/comboserver

USAGE

Usage: comboserver
-addr="localhost:8080": address to serve content from
-maxfiles=50: maximum files to concatenate in a single request
-root="/": root URL
-sep="&": file list separator

Example:

$ comboserver -addr=localhost:8081 -root=/combo /var/www

This will launch a web server serving files from /var/www. Suppose it
contains the following files:

base.css
pure/grids.css
pure/buttons.css

Then these files, concatenated, are available with a single request:

http://localhost:8081/combo?base.css&pure/grids.css&pure/buttons.css

Files can be combined in any way:

http://localhost:8081/combo?pure/buttons.css&base.css

The program preserves the order of request, doesn't allow repeated
filenames, and limits the number of files to 50 by default. Content-type
header of response is set to the type of the first file in list.

Comboserver doesn't do any caching, as it's a job of whatever nginx you put
in front of it.