Source

devsrvr / README.md

Full commit

devsrvr

devsrvr is a simple tool to ease local web development in the Go programming language. Its main purpose in life is to sit in front of your webapp and automatically recompile it as needed when new requests come in, making the edit/reload cycle much quicker and more productive.

Find the project online at http://bitbucket.org/liamstask/devsrvr

Usage

devsrvr has a couple expectations (at the moment): you use gomake to build your project your app listens via http directly (fcgi and others not yet supported)

If that works for you, then all that remains is the following: * create a config file called 'app.json' at the root level of your app, that looks like:

{
    "App": "myapp",
    "DevServerAddress": "127.0.0.1:8000",
    "AppAddress": "127.0.0.1:9000",
    "StartupTime": 10000000
}
  • 'App' is the name of your app's binary - this is the only required field
  • 'DevServerAddress' is the address that devsrvr will listen on - this is the one to enter into our browser
  • 'AppAddress' is the address to connect to your app on - essentially anything different than DevServerAddress is probably fine. Make sure this matches whatever your app is configured to listen on.
  • 'StartupTime' is an optional field to specify how long to wait (in nanoseconds) before connecting to your app after rebuilding it
  • devsrvr also currently assumes your Makefile is at the root level of your app as well, though that should probably be configurable

Now, navigate to your app's root directory and invoke devsrvr. Enter the value you used for 'DevServerAddress' into your browser and you should see your app. Make an edit, and reload your browser - magic!

License

devsrvr is available under the Apache License, Version 2.0.