Spaces:
Sleeping
Sleeping
Commit ·
f293df4
1
Parent(s): 1f25ee4
add new function and module
Browse files- app.R +4 -1
- services/a_services.R +9 -0
- services/b_services.R +9 -0
app.R
CHANGED
|
@@ -2,5 +2,8 @@ library(plumber)
|
|
| 2 |
library(tidyverse)
|
| 3 |
# 'plumber.R' is the location of the file shown above
|
| 4 |
|
| 5 |
-
pr(
|
|
|
|
|
|
|
|
|
|
| 6 |
pr_run(host = "0.0.0.0", port=7860)
|
|
|
|
| 2 |
library(tidyverse)
|
| 3 |
# 'plumber.R' is the location of the file shown above
|
| 4 |
|
| 5 |
+
pr() %>%
|
| 6 |
+
pr_mount("/a", path = "services/a_services.R") %>%
|
| 7 |
+
pr_mount("/b", path = "services/b_services.R") %>%
|
| 8 |
+
pr_mount("/utils", path = "function.R") %>%
|
| 9 |
pr_run(host = "0.0.0.0", port=7860)
|
services/a_services.R
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#* check if API run successfully
|
| 2 |
+
#* @serializer unboxedJSON
|
| 3 |
+
#* @get /check
|
| 4 |
+
function() {
|
| 5 |
+
message("--- message from service a")
|
| 6 |
+
list(
|
| 7 |
+
message = "Hello, dev!"
|
| 8 |
+
)
|
| 9 |
+
}
|
services/b_services.R
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#* check if API run successfully
|
| 2 |
+
#* @serializer unboxedJSON
|
| 3 |
+
#* @get /check
|
| 4 |
+
function() {
|
| 5 |
+
message("--- message from service b")
|
| 6 |
+
list(
|
| 7 |
+
message = "Hello, dev!"
|
| 8 |
+
)
|
| 9 |
+
}
|