# Name of this service service meteo # Comments can be included with hash # Newlines terminate a command. # Configuration: Settings that have to be configured. # There will be a uniform config handling framework # which reads data from a YAML file somewhere. config { # database is the data type. # db is the variable name. database db } GET /{zip} { # Validates input values. Throws an exception with the correct # HTTP status code if the input is not correct. validate zip /[0-9]{4}/ # Defines the variable data. SELECT statements are automatically # executed using the first database connection from config. # Use {bla} to reference a defined variable. weather = SELECT * FROM weather WHERE zip={zip} ORDER BY date ASC # Defines output for XML. This output can be requested in two ways: # - Requesting path with ".xml" at the end # - Sending accept-encoding with XML # <...> automatically starts an XML token. output.xml { {weather} } # Defines output for CSV. output.csv { {weather} } }