We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5057097 commit 3a1ad80Copy full SHA for 3a1ad80
motoko/hello_world/backend/app.mo
@@ -0,0 +1,14 @@
1
+actor HelloWorld {
2
+ // We store the greeting in a stable variable such that it gets persisted over canister upgrades.
3
+ stable var greeting : Text = "Hello, ";
4
+
5
+ // This update method stores the greeting prefix in stable memory.
6
+ public func setGreeting(prefix : Text) : async () {
7
+ greeting := prefix;
8
+ };
9
10
+ // This query method returns the currently persisted greeting with the given name.
11
+ public query func greet(name : Text) : async Text {
12
+ return greeting # name # "!";
13
14
+};
0 commit comments