15 lines
285 B
D
15 lines
285 B
D
module response;
|
|
|
|
import vibe.vibe;
|
|
|
|
struct Res {
|
|
bool error;
|
|
string message;
|
|
string data;
|
|
}
|
|
|
|
void send(HTTPServerResponse res, bool error = false, string message = "", string data = "") {
|
|
res.writeJsonBody(Res(
|
|
error, message, data
|
|
).serializeToJson());
|
|
}
|