Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
remote storage Recipe Module
RemoteStorage.defineModule('recipe', function(privateClient, publicClient) {
var baseProperties = {
"oven_temp": {
"description": "celsius or farenheit",
"type": "object",
"properties": {
"amount": {"type": "integer"},
"unit": {"type": "string", "enum": ["F", "C"]}
}
},
"servings": {
"type": "number"
},
"source_url": {
"description": "original recipe URL",
"type": "string"
},
"ingredients": {
"type": "object",
"properties": {
"ingredient": {"type": "string"},
"amount": {"type": "number"},
"unit": {"type": "string"},
}
},
"steps": {
"description": "steps necessary for the recipe",
"type": "object",
"properties": {
"step": {"type": "string"}
}
}
};
privateClient.declareType('recipe', {
"description": "Open Recipe Format",
"type": "object",
"properties": extend ({
"id": {
"type": "string",
"format": "id"
},
"name": {
"type": "string"
}
}, baseProperties)
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.