Skip to content

AugustNagro/serve

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Serve

A utility to serve files to localhost, auto-reloading index.html on file change.

Features:

  • Simple implementation in Java 8 with NO DEPENDENCIES: 12kb download.
  • Similar Node.js modules pull in hundreds to thousands (!!) of potentially insecure packages.
  • Implemented with standard NIO SocketChannels and Buffers; startup is fast.
  • Minimal resource usage: < 1mb memory with native WatchService, 3mb otherwise.

Download

serve.jar

Run It!

Serve is a simple executable jar... run however you'd like. I recommend:

java -Xmx3m -XX:+UseSerialGC -jar serve.jar

To use port other than 8085:

java -jar serve.jar <port>

To create an alias in .bash_profile:

mv serve.jar ~/serve.jar
echo 'alias serve="java -Xmx3m -XX:+UseSerialGC -jar ~/serve.jar"' >> .bash_profile

Implementation Notes:

About

Webdev Auto-Reload in 12 kilobytes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages