@@ 0,0 1,85 @@
+# getcraft
+
+a simple json "API" engine
+
+## Routes
+
+Routes are in the routes.json file
+
+### Arguments
+
+- req = link (/link/to/thing)
+- type = What you want to do with your link
+- res = what is the target
+
+### Types
+
+ - text, sends res as text
+ - file, sends file content
+ - directory, sends files contents in directory as json
+ ```json
+ [
+ {
+ "filename": "file1",
+ "content": "CoolFile"
+ },
+ {
+ "filename": "file2",
+ "content": "Nice content"
+ }
+ ]
+ ```
+ - route
+ - get, returns the content of the routing array as json
+ - refresh, refresh the routes array
+
+#### optional
+
+- status = force http status code
+
+## Example
+
+```json
+{
+ "routes": [
+
+ // Respond with text
+ {
+ "req": "/text",
+ "type": "text",
+ "res": "text"
+ },
+ // Respond with the content of a file
+ {
+ "req": "/index",
+ "type": "file",
+ "res": "src/index.lua"
+ },
+ // Respond with a json containing file names and content
+ {
+ "req": "/src",
+ "type": "directory",
+ "res": "src/"
+ },
+
+ // Get the possible routes and their actions
+ {
+ "req": "/rg",
+ "type": "route get"
+ },
+ // Refresh the routes file
+ {
+ "req": "/rr",
+ "type": "route refresh"
+ },
+
+ // Optionally give http status code
+ {
+ "req": "/500",
+ "type": "text",
+ "status": 500,
+ "res": "oh no"
+ }
+ ]
+}
+```<
\ No newline at end of file