Skip to content

Instantly share code, notes, and snippets.

@vinipsmaker
Last active December 11, 2015 21:49
Show Gist options
  • Save vinipsmaker/4665603 to your computer and use it in GitHub Desktop.
Save vinipsmaker/4665603 to your computer and use it in GitHub Desktop.
A draft of the new Tufão's plugin system file format.
{
"version": 0,
"plugins": [
{
"name": "home",
"path": "/home/vinipsmaker/Projetos/tufao-project42/build/plugins/libhome.so",
"customData": {"appName": "Hello World", "root": "/"}
},
{
"name": "user",
"path": "...",
"dependencies": ["home"]
},
{
"name": "404",
"path": "/usr/lib/tufao/plugins/notfound.so",
"customData": "<h1>Not Found</h1><p>I'm sorry, but it's your fault</p>"
}
],
"requests": [
{
"path": "^/$",
"plugin": "home",
"method": "GET"
},
{
"path": "^/user/(\\w*)$",
"plugin": "user"
},
{
"path": "",
"plugin": "404"
}
]
}
@vinipsmaker
Copy link
Author

You may want to catch requests programmatically, outside of the plugins. If I add the suggested behaviour, this would be difficult.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment