mirror of
https://github.com/openfaas/faas.git
synced 2025-06-20 04:56:38 +00:00
Disable KeepAlive on proxy (#21)
* Service lookup * Disable KeepAlive to force RR for replias. * set KeepAlive to 0 * Remove temporary file * Support white and rename function * Remove debug from node sample
This commit is contained in:
@ -6,11 +6,11 @@ ADD https://github.com/alexellis/faas/releases/download/v0.3-alpha/fwatchdog /us
|
||||
RUN chmod +x /usr/bin/fwatchdog
|
||||
|
||||
COPY package.json .
|
||||
RUN npm i
|
||||
COPY handler.js .
|
||||
COPY sendColor.js .
|
||||
COPY sample_response.json .
|
||||
|
||||
RUN npm i
|
||||
|
||||
ENV fprocess="node handler.js"
|
||||
CMD ["fwatchdog"]
|
||||
|
@ -1,4 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
docker build -t alexellis2/faas-alexachangecolorintent:latest-dev1 .
|
||||
#!/bin/sh
|
||||
|
||||
docker build -t functions/alexa-leds:latest .
|
||||
|
@ -12,7 +12,6 @@ getStdin().then(content => {
|
||||
});
|
||||
|
||||
function tellWithCard(speechOutput, request) {
|
||||
// console.log(sample)
|
||||
sample.response.session = request.session;
|
||||
sample.response.outputSpeech.text = speechOutput;
|
||||
sample.response.card.content = speechOutput;
|
||||
@ -23,8 +22,6 @@ function tellWithCard(speechOutput, request) {
|
||||
}
|
||||
|
||||
function handle(request, intent) {
|
||||
// console.log("Intent: " + intent.name);
|
||||
|
||||
if(intent.name == "TurnOffIntent") {
|
||||
let req = {r:0,g:0,b:0};
|
||||
var speechOutput = "Lights off.";
|
||||
@ -40,12 +37,15 @@ function handle(request, intent) {
|
||||
req.b = 255;
|
||||
} else if (colorRequested == "green") {
|
||||
req.g = 255;
|
||||
} else if (colorRequested == "white") {
|
||||
req.r = 255;
|
||||
req.g = 103;
|
||||
req.b = 23;
|
||||
} else {
|
||||
let msg = "I heard "+colorRequested+ " but can only show: red, green, blue and white.";
|
||||
return tellWithCard(msg, request);
|
||||
}
|
||||
else {
|
||||
return tellWithCard("I heard "+colorRequested+
|
||||
" but can only do: red, green, blue.",
|
||||
"I heard "+colorRequested+ " but can only do: red, green, blue.", request);
|
||||
}
|
||||
|
||||
sendColor.sendColor(req, () => {
|
||||
var speechOutput = "OK, " + colorRequested + ".";
|
||||
return tellWithCard(speechOutput, request);
|
||||
|
Reference in New Issue
Block a user