Last active
December 11, 2015 21:49
-
-
Save vinipsmaker/4665603 to your computer and use it in GitHub Desktop.
A draft of the new Tufão's plugin system file format.
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
{ | |
"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" | |
} | |
] | |
} |
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
Maybe for the 404 case we don't need say the path, and all other paths go to 404 plugin!