diff --git a/api/source/app.d b/api/source/app.d index 3b66c27..308d93f 100644 --- a/api/source/app.d +++ b/api/source/app.d @@ -1,13 +1,15 @@ import handy_httpd; import handy_httpd.handlers.path_handler; -import std.stdio; import d2sqlite3; +import std.process; import db; import api_modules.auth; static import api_modules.classroom_compliance; void main() { + string env = environment.get("TEACHER_TOOLS_API_ENV", "DEV"); + // Initialize the database on startup. auto db = getDb(); db.close(); @@ -22,6 +24,11 @@ void main() { config.defaultHeaders["Access-Control-Request-Method"] = "*"; config.defaultHeaders["Access-Control-Allow-Headers"] = "Authorization, Content-Length, Content-Type"; + if (env == "PROD") { + config.port = 8107; + config.workerPoolSize = 5; + } + PathHandler handler = new PathHandler(); handler.addMapping(Method.OPTIONS, "/api/**", &optionsEndpoint); diff --git a/app/.env.production b/app/.env.production new file mode 100644 index 0000000..ce34da5 --- /dev/null +++ b/app/.env.production @@ -0,0 +1 @@ +VITE_API_URL=https://teacher-tools.andrewlalis.com/api \ No newline at end of file diff --git a/app/src/apps/classroom_compliance/ClassView.vue b/app/src/apps/classroom_compliance/ClassView.vue index 1cd48a7..7a03211 100644 --- a/app/src/apps/classroom_compliance/ClassView.vue +++ b/app/src/apps/classroom_compliance/ClassView.vue @@ -37,6 +37,8 @@ async function deleteThisClass() {
diff --git a/app/src/apps/classroom_compliance/ImportStudentsView.vue b/app/src/apps/classroom_compliance/ImportStudentsView.vue new file mode 100644 index 0000000..e7e60d1 --- /dev/null +++ b/app/src/apps/classroom_compliance/ImportStudentsView.vue @@ -0,0 +1,51 @@ + + ++ Import a large number of students to a class at once by pasting their names in the text box below, with one + student per line. +
+ +