diff --git a/api/controller.js b/api/controller.js
index 949731c..a9efaf1 100644
--- a/api/controller.js
+++ b/api/controller.js
@@ -16,6 +16,7 @@ exports.calculate = function(req, res) {
'subtract': function(a, b) { return a - b },
'multiply': function(a, b) { return a * b },
'divide': function(a, b) { return a / b },
+ 'power': function(a, b) { return Math.pow(a, b) },
};
if (!req.query.operation) {
diff --git a/package-lock.json b/package-lock.json
index 24b926b..dfcc61c 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -764,6 +764,17 @@
"node": ">=0.10.0"
}
},
+ "node_modules/bindings": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
+ "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "file-uri-to-path": "1.0.0"
+ }
+ },
"node_modules/body-parser": {
"version": "1.18.3",
"license": "MIT",
@@ -2264,6 +2275,14 @@
"node": "^10.12.0 || >=12.0.0"
}
},
+ "node_modules/file-uri-to-path": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
+ "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
+ "dev": true,
+ "license": "MIT",
+ "optional": true
+ },
"node_modules/fill-range": {
"version": "4.0.0",
"dev": true,
@@ -2467,6 +2486,26 @@
"dev": true,
"license": "ISC"
},
+ "node_modules/fsevents": {
+ "version": "1.2.13",
+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz",
+ "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==",
+ "deprecated": "Upgrade to fsevents v2 to mitigate potential security issues",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "dependencies": {
+ "bindings": "^1.5.0",
+ "nan": "^2.12.1"
+ },
+ "engines": {
+ "node": ">= 4.0"
+ }
+ },
"node_modules/function-bind": {
"version": "1.1.1",
"dev": true,
@@ -3744,6 +3783,14 @@
"node": ">= 0.10"
}
},
+ "node_modules/nan": {
+ "version": "2.30.0",
+ "resolved": "https://registry.npmjs.org/nan/-/nan-2.30.0.tgz",
+ "integrity": "sha512-P5mokDkSvCGBz6mZDD/2l+w9QoICRXdCyZ9ONGmTePr40oihJg3Kpn0YU3twKd6PJnwSlLBWNQeOT6yWEV2c4A==",
+ "dev": true,
+ "license": "MIT",
+ "optional": true
+ },
"node_modules/nanomatch": {
"version": "1.2.13",
"dev": true,
diff --git a/public/client.js b/public/client.js
index 1c60f86..1227a95 100644
--- a/public/client.js
+++ b/public/client.js
@@ -33,6 +33,9 @@ function calculate(operand1, operand2, operation) {
case '/':
uri += "?operation=divide";
break;
+ case '^':
+ uri += "?operation=power";
+ break;
default:
setError();
return;
diff --git a/public/index.html b/public/index.html
index 400c454..d68be1c 100644
--- a/public/index.html
+++ b/public/index.html
@@ -38,9 +38,9 @@
+
-