21 lines
698 B
JavaScript
21 lines
698 B
JavaScript
/* config.js — константы и шаблоны языков */
|
|
|
|
const LANG_TEMPLATES = {
|
|
python: {
|
|
entrypoint: 'main.main',
|
|
code: 'def main():\n return {"ok": True}'
|
|
},
|
|
nodejs: {
|
|
entrypoint: 'main',
|
|
code: 'module.exports = async function(context) {\n return {\n status: 200,\n body: "hello from fission"\n };\n}'
|
|
},
|
|
php: {
|
|
entrypoint: 'main.php::handler',
|
|
code: '<?php\nfunction handler($context)\n{\n $response = $context["response"];\n $response->getBody()->write("hello from fission");\n}'
|
|
},
|
|
ruby: {
|
|
entrypoint: 'handler',
|
|
code: '# frozen_string_literal: true\n\ndef handler\n "hello from fission"\nend'
|
|
}
|
|
};
|