diff --git a/09_goals/README.md b/09_goals/README.md index ae012b2..b7938bb 100644 --- a/09_goals/README.md +++ b/09_goals/README.md @@ -7,7 +7,7 @@ You will be able to **C**reate, **R**ead, **U**pdate & **D**elete Goals. Here's what's covered: - Ambiorix + MongoDB -- Working with middleware: +- Working with middleware: - Auth middleware: You will learn how you can use Jason Web Tokens ([JWT](https://jwt.io/)) to protect routes - Error handling middleware @@ -15,3 +15,24 @@ Here's what's covered: - An installation of the community edition of [MongoDB](https://www.mongodb.com/docs/manual/installation/) - The [mongolite](https://github.com/jeroen/mongolite) R pkg + +## Run API + +1. `cd` into the `backend/` dir: + + ```bash + cd backend + ``` + +1. Fire up R and restore package dependencies: + + ```r + renv::restore() + ``` + +1. `server.R` is the entry point. Run this command in the terminal to start the + API: + + ```bash + Rscript server.R + ``` diff --git a/09_goals/backend/.Rprofile b/09_goals/backend/.Rprofile new file mode 100644 index 0000000..81b960f --- /dev/null +++ b/09_goals/backend/.Rprofile @@ -0,0 +1 @@ +source("renv/activate.R") diff --git a/09_goals/renv.lock b/09_goals/backend/renv.lock similarity index 97% rename from 09_goals/renv.lock rename to 09_goals/backend/renv.lock index f187b5c..71c2491 100644 --- a/09_goals/renv.lock +++ b/09_goals/backend/renv.lock @@ -13,7 +13,7 @@ "Package": "R6", "Version": "2.5.1", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R" ], @@ -131,7 +131,7 @@ "Package": "cli", "Version": "3.6.2", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R", "utils" @@ -149,7 +149,7 @@ "Package": "cpp11", "Version": "0.4.7", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R" ], @@ -159,7 +159,7 @@ "Package": "crayon", "Version": "1.5.2", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "grDevices", "methods", @@ -223,7 +223,7 @@ "Package": "glue", "Version": "1.7.0", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R", "methods" @@ -286,7 +286,7 @@ "Package": "jsonlite", "Version": "1.8.8", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "methods" ], @@ -307,7 +307,7 @@ "Package": "lifecycle", "Version": "1.0.4", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R", "cli", @@ -345,7 +345,7 @@ "Package": "magrittr", "Version": "2.0.3", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R" ], @@ -492,7 +492,7 @@ "Package": "sodium", "Version": "1.3.1", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Hash": "dd86d6fd2a01d4eb3777dfdee7076d56" }, "sourcetools": { @@ -537,7 +537,7 @@ "Package": "withr", "Version": "3.0.0", "Source": "Repository", - "Repository": "CRAN", + "Repository": "RSPM", "Requirements": [ "R", "grDevices", diff --git a/09_goals/renv/.gitignore b/09_goals/backend/renv/.gitignore similarity index 100% rename from 09_goals/renv/.gitignore rename to 09_goals/backend/renv/.gitignore diff --git a/09_goals/renv/activate.R b/09_goals/backend/renv/activate.R similarity index 100% rename from 09_goals/renv/activate.R rename to 09_goals/backend/renv/activate.R diff --git a/09_goals/renv/settings.json b/09_goals/backend/renv/settings.json similarity index 100% rename from 09_goals/renv/settings.json rename to 09_goals/backend/renv/settings.json