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
const Alexa = require('ask-sdk-core'); | |
exports.handler = (event, context, callback) => { | |
console.log(`event: ${JSON.stringify(event)}`); | |
var jsonStr = null; | |
if (event.header !== undefined && event.header.name == "GetPlayableContent") { | |
jsonStr = `{ | |
"header": { | |
"messageId": "00ef1e9a-140b-485c-bc2c-5b9556cee492", | |
"namespace": "Alexa.Media.Search", |
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
var customer = new Customer { Name="Joe Bloggs", Age=31 }; | |
var json = JsonSerializer.SerializeToString(customer); | |
var fromJson = JsonSerializer.DeserializeFromString<Customer>(json); |
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
Get["/idea/{id}"] = parameters => | |
{ | |
using (var db = new IdeastrikeContext()) | |
{ | |
int id = parameters.id; | |
var idea = db.Ideas.Where(i => i.Id == id).FirstOrDefault(); | |
return string.Format("Id: {0}, Title: {1} Description: {2}", idea.Id, idea.Title, idea.Description); | |
} | |
}; |
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
/user/{id} | |
/user/create | |
/user/{id}/delete | |
/user/{id}/update | |
/idea/{id} | |
/idea/create | |
/idea/{id}/delete | |
/idea/{id}/update |
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
using System.Collections.Generic; | |
using Jabbot.CommandSprockets; | |
namespace WeatherSprocket | |
{ | |
public class WeatherSprocket : CommandSprocket | |
{ | |
public override IEnumerable<string> SupportedInitiators | |
{ | |
get { yield return "weather"; } |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Home</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" /> | |
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script> | |
<script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script> | |
<script src="json2.js"></script> | |
<script> |