forked from brianklaas/awsPlaybox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshowSourceCode.cfm
executable file
·98 lines (91 loc) · 3.92 KB
/
showSourceCode.cfm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<cfif structKeyExists(URL, "fileToGrab")>
<cfswitch expression="#Trim(URL.fileToGrab)#">
<cfcase value="pySubscribe">
<cfset fileTitle = "Python: Subscribe to a SNS Topic via Email" />
<cfset pathToFile = "/awsPlaybox/python/sns/subscribeViaEmail.py" />
</cfcase>
<cfcase value="pySendSNS">
<cfset fileTitle = "Python: Send a Test SNS Notification" />
<cfset pathToFile = "/awsPlaybox/python/sns/publishToSNS.py" />
</cfcase>
<cfcase value="pyCheckServers">
<cfset fileTitle = "Python: Check Servers" />
<cfset pathToFile = "/awsPlaybox/python/lambda/checkServers.py" />
</cfcase>
<cfcase value="jsLargeFile">
<cfset fileTitle = "Node: Check for Large File Uploads" />
<cfset pathToFile = "/awsPlaybox/nodejs/lambda/checkForLargeFileUploads.js" />
</cfcase>
<cfcase value="jsReturnData">
<cfset fileTitle = "Node: Return Data to Caller" />
<cfset pathToFile = "/awsPlaybox/nodejs/lambda/returnDataToCaller.js" />
</cfcase>
<cfcase value="jsGenerateRandom">
<cfset fileTitle = "Node: Generate Random Number" />
<cfset pathToFile = "/awsPlaybox/nodejs/lambda/generateRandomNumber.js" />
</cfcase>
<cfcase value="jsDetectLabels">
<cfset fileTitle = "Node: Detect Labels for the Provided Image" />
<cfset pathToFile = "/awsPlaybox/nodejs/lambda/detectLabelsForImage.js" />
</cfcase>
<cfcase value="stateMachineChoiceDemo">
<cfset fileTitle = "State Machine: A Sample Choice State Machine" />
<cfset pathToFile = "/awsPlaybox/stateMachines/choiceDemoStateMachine.json" />
</cfcase>
<cfcase value="transcribeTanslateStepFunc">
<cfset fileTitle = "State Machine: Transcribe a Video, Translate, and Speak Tranlation" />
<cfset pathToFile = "/awsPlaybox/stateMachines/transcribeTranslateSpeakWorkflow.json" />
</cfcase>
<cfcase value="vwfStartTranscribe">
<cfset fileTitle = "Node: Start Transcribe Job" />
<cfset pathToFile = "/awsPlaybox/nodejs/lambda/translateTranscribeExample/startTranscribeJob.js" />
</cfcase>
<cfcase value="vwfCheckTranscribeJob">
<cfset fileTitle = "Node: Check Transcribe Job Status" />
<cfset pathToFile = "/awsPlaybox/nodejs/lambda/translateTranscribeExample/checkTranscribeJobStatus.js" />
</cfcase>
<cfcase value="vwfGetTranscript">
<cfset fileTitle = "Node: Get Transcription File" />
<cfset pathToFile = "/awsPlaybox/nodejs/lambda/translateTranscribeExample/getTranscriptionFile.js" />
</cfcase>
<cfcase value="vwfTranslateText">
<cfset fileTitle = "Node: Translate Text" />
<cfset pathToFile = "/awsPlaybox/nodejs/lambda/translateTranscribeExample/translateText.js" />
</cfcase>
<cfcase value="vwfPrepTranlation">
<cfset fileTitle = "Node: Prep Translated Text for Speech" />
<cfset pathToFile = "/awsPlaybox/nodejs/lambda/translateTranscribeExample/prepTranslatedTextForSpeech.js" />
</cfcase>
<cfcase value="vwfTextToSpeech">
<cfset fileTitle = "Node: Convert Text to Speech" />
<cfset pathToFile = "/awsPlaybox/nodejs/lambda/translateTranscribeExample/convertTextToSpeech.js" />
</cfcase>
<cfdefaultcase>
<cfthrow message="Unsupported action requested" detail="You have requested a file (#URL.fileToGrab#) which is not supported at this time." />
</cfdefaultcase>
</cfswitch>
</cfif>
<cfcontent reset="true" />
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>AWS Playbox: AWS Service Demos</title>
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700,800' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="assets/styles.css?v=1.0">
</head>
<body>
<div align="center">
<div id="mainBox">
<h3>AWS Service Demos:</h3>
<h1>Lambda</h1>
<h3>Code Example: <cfoutput>#fileTitle#</cfoutput></h3>
<cffile action="read" file="#expandPath(pathToFile)#" variable="sourceCode">
<cfoutput>
<pre>#sourceCode#</pre>
</cfoutput>
<p align="right" ><a href="index.cfm" class="homeButton">Home</a></p>
</div>
</div>
</body>
</html>