reserved

A simple way to run your D scripts/applications on a webserver

1 import std.stdio;
2 import reserved.reserved;
3 
4 @ReservedResponse
5 void response(Request req, Output output)
6 {
7  // A really useful application.
8  output ~= "Hello ";
9  if ("name" in req.get) output ~= req.get["name"];
10  else output ~= "World";
11 }
12 
13 mixin Reserved!"awesome_d_webservice";

Members

Classes

Output
class Output

Your reply.

Request
class Request

A request from user

Enums

ReservedInit
enum ReservedInit

UDA. Annotate a function `bool your_function()` or `bool your_function(string[] args)` to execute it once before the first request.

ReservedResponse
enum ReservedResponse

UDA. Annotate a function `void response(Request req, Output output)` that will be called for each request.

Functions

reservedLog
void reservedLog(T params)

Write a formatted log

Structs

Cookie
struct Cookie

A cookie

Templates

Reserved
template Reserved(string serviceName)

Remember to mixin this on your main file.

Meta