Skip to content

Commit

Permalink
chore: fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
loks0n committed Jul 22, 2023
1 parent 6b997ae commit 62ffef8
Showing 1 changed file with 25 additions and 26 deletions.
51 changes: 25 additions & 26 deletions cpp/src/main.cc
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
namespace runtime {
class Handler {
public:
// This is your Appwrite function
// It's executed each time we get a request
static RuntimeOutput main(RuntimeContext &context) {
// You can log messages to the console
context.log("Hello, Logs! πŸ‘‹");
class Handler {
public:
// This is your Appwrite function
// It's executed each time we get a request
static RuntimeOutput main(RuntimeContext &context) {
// You can log messages to the console
context.log("Hello, Logs! πŸ‘‹");

// If something goes wrong, log an error
context.log("Hello, Errors! β›”");
// If something goes wrong, log an error
context.log("Hello, Errors! β›”");

// The `req` object contains the request data
if (context.req.method == "GET") {
// Send a response with the res object helpers
// `context.res.send()` dispatches a string back to the client
return context.res.send("Hello, World! 🌎");
}
// The `req` object contains the request data
if (context.req.method == "GET") {
// Send a response with the res object helpers
// `context.res.send()` dispatches a string back to the client
return context.res.send("Hello, World! 🌎");
}

// `context.res.json()` is a handy helper for sending JSON
Json::Value response;
response['motto'] = "Build Fast. Scale Big. All in One Place.";
response['learn'] = "https://appwrite.io/docs";
response['connect'] = "https://appwrite.io/discord";
response['getInspired'] = "https://builtwith.appwrite.io";

return context.res.json(response);
}
};
}
// `context.res.json()` is a handy helper for sending JSON
Json::Value response;
response['motto'] = "Build Fast. Scale Big. All in One Place.";
response['learn'] = "https://appwrite.io/docs";
response['connect'] = "https://appwrite.io/discord";
response['getInspired'] = "https://builtwith.appwrite.io";
return context.res.json(response);
}
};
}

0 comments on commit 62ffef8

Please sign in to comment.