-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from CSE2102-Fall23/createcourselambda
added .gitignore and jack's lambda code to create a course from the api
- Loading branch information
Showing
2 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
.DS_Store | ||
dist | ||
dist-ssr | ||
coverage | ||
*.local | ||
|
||
/cypress/videos/ | ||
/cypress/screenshots/ | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
'use strict'; | ||
|
||
console.log('Loading function'); | ||
|
||
export const handler = function(event, context, callback) { | ||
// Parse the input for the class, days, professor, and major property values | ||
let className = event.class === undefined ? 'Unknown Class' : event.class; | ||
let classDays = event.days === undefined ? 'Unknown Days' : event.days; | ||
let professor = event.professor === undefined ? 'Unknown Professor' : event.professor; | ||
let major = event.major === undefined ? 'Unknown Major' : event.major; | ||
|
||
// Construct the "Class Added" message | ||
let classAddedMessage = `Class Added: ${className}, taught by Professor ${professor}.`; | ||
classAddedMessage += ` This class is scheduled for ${classDays} and the major is ${major}.`; | ||
|
||
// Log the message to CloudWatch | ||
console.log(classAddedMessage); | ||
|
||
// Return the "Class Added" message to the caller as a JSON object | ||
callback(null, { | ||
"message": classAddedMessage | ||
}); | ||
}; |