-
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.
- Loading branch information
pc
committed
Sep 14, 2019
1 parent
1880fe1
commit 3defa46
Showing
14 changed files
with
2,306 additions
and
155 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,11 @@ | ||
const loginHandler = async (event, context, callback) => { | ||
|
||
} | ||
|
||
const listExams = async (event, context, callback) => { | ||
|
||
} | ||
|
||
const listEntries = async (event, context, callback) => { | ||
|
||
} |
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,17 @@ | ||
adminPortal: | ||
handler: api/handler.apiAdminHandler | ||
description: Endpoints to handle all test portal requests | ||
events: | ||
- http: | ||
path: admin | ||
method: POST | ||
cors: true | ||
|
||
studentPortal: | ||
handler: api/handler.apiCandidateHandler | ||
description: Endpoints to handle all test portal requests | ||
events: | ||
- http: | ||
path: test | ||
method: POST | ||
cors: true |
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,11 @@ | ||
const registerHandler = async (event, context, callback) => { | ||
|
||
} | ||
|
||
const listQuestions = async (event, context, callback) => { | ||
|
||
} | ||
|
||
const getQuestion = async (event, context, callback) => { | ||
|
||
} |
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,49 @@ | ||
'use strict'; | ||
|
||
const loginHandler = async (event, context, callback) => { | ||
// | ||
} | ||
|
||
const registerHandler = async (event, context, callback) => { | ||
// | ||
} | ||
|
||
module.exports.apiAdminHandler = async (event, context, callback) => { | ||
let body = event.body | ||
if(typeof body == 'string'){ | ||
body = JSON.parse(body) | ||
} | ||
switch (body) { | ||
case 'login': | ||
loginHandler(event, context, callback) | ||
break; | ||
case 'listExams': | ||
listExams(event, context, callback) | ||
case 'listEntries': | ||
listEntries(event, context, callback) | ||
break; | ||
|
||
default: | ||
break; | ||
} | ||
} | ||
|
||
module.exports.apiCandidateHandler = async (event, context, callback) => { | ||
let body = event.body | ||
if(typeof body == 'string'){ | ||
body = JSON.parse(body) | ||
} | ||
switch (body) { | ||
case 'register': | ||
registerHandler(event, context, callback) | ||
break; | ||
case 'listQuestions': | ||
listQuestions(event, context, callback) | ||
break; | ||
case 'getQuestion': | ||
getQuestion(event, context, callback) | ||
break; | ||
default: | ||
break; | ||
} | ||
} |
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,3 @@ | ||
appStage: dev | ||
appRegion: localhost | ||
appDBPath: /media/pc/Store/Projects/data/dynamodb |
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,49 @@ | ||
Type: 'AWS::DynamoDB::Table' | ||
DeletionPolicy: Retain | ||
Properties: | ||
TableName: ${self:service}Candidate${self:custom.config.appStage} | ||
AttributeDefinitions: | ||
- | ||
AttributeName: id | ||
AttributeType: S | ||
- | ||
AttributeName: examId | ||
AttributeType: S | ||
- | ||
AttributeName: lastModifiedOn | ||
AttributeType: N | ||
|
||
KeySchema: | ||
- | ||
AttributeName: id | ||
KeyType: HASH | ||
- | ||
AttributeName: lastModifiedOn | ||
KeyType: RANGE | ||
|
||
GlobalSecondaryIndexes: | ||
- IndexName: idIndex | ||
KeySchema: | ||
- AttributeName: id | ||
KeyType: HASH | ||
Projection: | ||
ProjectionType: ALL | ||
ProvisionedThroughput: | ||
ReadCapacityUnits: 1 | ||
WriteCapacityUnits: 1 | ||
|
||
- IndexName: examIdIndex | ||
KeySchema: | ||
- AttributeName: examId | ||
KeyType: HASH | ||
- AttributeName: lastModifiedOn | ||
KeyType: RANGE | ||
Projection: | ||
ProjectionType: ALL | ||
ProvisionedThroughput: | ||
ReadCapacityUnits: 1 | ||
WriteCapacityUnits: 1 | ||
|
||
ProvisionedThroughput: | ||
ReadCapacityUnits: 1 | ||
WriteCapacityUnits: 1 |
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,50 @@ | ||
Type: 'AWS::DynamoDB::Table' | ||
DeletionPolicy: Retain | ||
Properties: | ||
TableName: ${self:service}Exam${self:custom.config.appStage} | ||
AttributeDefinitions: | ||
- | ||
AttributeName: id | ||
AttributeType: S | ||
- | ||
AttributeName: status | ||
AttributeType: S | ||
- | ||
AttributeName: createdOn | ||
AttributeType: N | ||
|
||
|
||
KeySchema: | ||
- | ||
AttributeName: id | ||
KeyType: HASH | ||
- | ||
AttributeName: createdOn | ||
KeyType: RANGE | ||
|
||
GlobalSecondaryIndexes: | ||
- IndexName: idIndex | ||
KeySchema: | ||
- AttributeName: id | ||
KeyType: HASH | ||
Projection: | ||
ProjectionType: ALL | ||
ProvisionedThroughput: | ||
ReadCapacityUnits: 1 | ||
WriteCapacityUnits: 1 | ||
|
||
- IndexName: statusIndex | ||
KeySchema: | ||
- AttributeName: status | ||
KeyType: HASH | ||
- AttributeName: createdOn | ||
KeyType: RANGE | ||
Projection: | ||
ProjectionType: ALL | ||
ProvisionedThroughput: | ||
ReadCapacityUnits: 1 | ||
WriteCapacityUnits: 1 | ||
|
||
ProvisionedThroughput: | ||
ReadCapacityUnits: 1 | ||
WriteCapacityUnits: 1 |
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 |
---|---|---|
@@ -1,42 +1,49 @@ | ||
Type: 'AWS::DynamoDB::Table' | ||
DeletionPolicy: Retain | ||
Properties: | ||
TableName: users | ||
AttributeDefinitions: | ||
- AttributeName: id | ||
AttributeType: S | ||
|
||
- AttributeName: test_id | ||
AttributeType: S | ||
|
||
KeySchema: | ||
- AttributeName: id | ||
KeyType: HASH | ||
|
||
GlobalSecondaryIndexes: | ||
- | ||
IndexName: testIndex | ||
KeySchema: | ||
- | ||
AttributeName: test_id | ||
KeyType: HASH | ||
Projection: | ||
ProjectionType: ALL | ||
ProvisionedThroughput: | ||
ReadCapacityUnits: 1 | ||
WriteCapacityUnits: 1 | ||
- | ||
IndexName: testIndex | ||
KeySchema: | ||
- | ||
AttributeName: test_id | ||
KeyType: HASH | ||
Projection: | ||
ProjectionType: ALL | ||
ProvisionedThroughput: | ||
ReadCapacityUnits: 1 | ||
WriteCapacityUnits: 1 | ||
|
||
ProvisionedThroughput: | ||
ReadCapacityUnits: 1 | ||
WriteCapacityUnits: 1 | ||
Type: 'AWS::DynamoDB::Table' | ||
DeletionPolicy: Retain | ||
Properties: | ||
TableName: ${self:service}Question${self:custom.config.appStage} | ||
AttributeDefinitions: | ||
- | ||
AttributeName: id | ||
AttributeType: S | ||
- | ||
AttributeName: examId | ||
AttributeType: S | ||
- | ||
AttributeName: createdOn | ||
AttributeType: N | ||
|
||
KeySchema: | ||
- | ||
AttributeName: id | ||
KeyType: HASH | ||
- | ||
AttributeName: createdOn | ||
KeyType: RANGE | ||
|
||
GlobalSecondaryIndexes: | ||
- IndexName: idIndex | ||
KeySchema: | ||
- AttributeName: id | ||
KeyType: HASH | ||
Projection: | ||
ProjectionType: ALL | ||
ProvisionedThroughput: | ||
ReadCapacityUnits: 1 | ||
WriteCapacityUnits: 1 | ||
|
||
- IndexName: examIdIndex | ||
KeySchema: | ||
- AttributeName: examId | ||
KeyType: HASH | ||
- AttributeName: createdOn | ||
KeyType: RANGE | ||
Projection: | ||
ProjectionType: ALL | ||
ProvisionedThroughput: | ||
ReadCapacityUnits: 1 | ||
WriteCapacityUnits: 1 | ||
|
||
ProvisionedThroughput: | ||
ReadCapacityUnits: 1 | ||
WriteCapacityUnits: 1 |
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,24 @@ | ||
Type: 'AWS::DynamoDB::Table' | ||
DeletionPolicy: Retain | ||
Properties: | ||
TableName: ${self:service}User${self:custom.config.appStage} | ||
AttributeDefinitions: | ||
- | ||
AttributeName: email | ||
AttributeType: S | ||
- | ||
AttributeName: password | ||
AttributeType: S | ||
|
||
KeySchema: | ||
- | ||
AttributeName: email | ||
KeyType: HASH | ||
- | ||
AttributeName: password | ||
KeyType: RANGE | ||
|
||
|
||
ProvisionedThroughput: | ||
ReadCapacityUnits: 1 | ||
WriteCapacityUnits: 1 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.