TheBellhouse / config

euporias - ceramic bell project - video stream sampler
0 stars 0 forks source link

Get client code running against fixtures so we can dev without server. #5

Closed katjam closed 3 years ago

katjam commented 3 years ago

I have set up a mockoon

katjam commented 3 years ago

{ "source": "mockoon:1.11.0", "data": [ { "type": "environment", "item": { "uuid": "", "lastMigration": 13, "name": "Bellhouse", "endpointPrefix": "", "latency": 0, "port": 3001, "routes": [ { "uuid": "", "documentation": "", "method": "get", "endpoint": "", "responses": [ { "uuid": "", "body": "{\"started\": true}", "latency": 0, "statusCode": 200, "label": "", "headers": [ { "key": "", "value": "" } ], "filePath": "", "sendFileAsBody": false, "rules": [], "rulesOperator": "OR", "disableTemplating": false } ], "enabled": true, "randomResponse": false }, { "uuid": "", "documentation": "", "method": "get", "endpoint": "recording/stop", "responses": [ { "uuid": "", "body": "no record file currently instantiated", "latency": 0, "statusCode": 200, "label": "", "headers": [ { "key": "", "value": "" } ], "filePath": "", "sendFileAsBody": false, "rules": [], "rulesOperator": "OR", "disableTemplating": false } ], "enabled": true, "randomResponse": false }, { "uuid": "", "documentation": "", "method": "get", "endpoint": "hats", "responses": [ { "uuid": "", "body": "{\"hats\": [{\"id\": 0, \"address\": \"0x40\"}, {\"id\": 1, \"address\": \"0x41\"}, {\"id\": 2, \"address\": \"0x42\"}]}", "latency": 0, "statusCode": 200, "label": "", "headers": [ { "key": "", "value": "" } ], "filePath": "", "sendFileAsBody": false, "rules": [], "rulesOperator": "OR", "disableTemplating": false } ], "enabled": true, "randomResponse": false }, { "uuid": "", "documentation": "", "method": "get", "endpoint": "servos", "responses": [ { "uuid": "", "body": "{\"servos\": [{\"init_deg\": 0, \"hat\": {\"id\": 1, \"address\": \"0x41\"}, \"id\": 16, \"channel\": 0, \"rotate_to_deg\": 33}, {\"init_deg\": 0, \"hat\": {\"id\": 1, \"address\": \"0x41\"}, \"id\": 27, \"channel\": 11, \"rotate_to_deg\": 43}, {\"init_deg\": 0, \"hat\": {\"id\": 0, \"address\": \"0x40\"}, \"id\": 13, \"channel\": 13, \"rotate_to_deg\": 37}, {\"init_deg\": 0, \"hat\": {\"id\": 0, \"address\": \"0x40\"}, \"id\": 2, \"channel\": 2, \"rotate_to_deg\": 40}, {\"init_deg\": 0, \"hat\": {\"id\": 0, \"address\": \"0x40\"}, \"id\": 4, \"channel\": 4, \"rotate_to_deg\": 33}, {\"init_deg\": 0, \"hat\": {\"id\": 0, \"address\": \"0x40\"}, \"id\": 6, \"channel\": 6, \"rotate_to_deg\": 42}, {\"init_deg\": 0, \"hat\": {\"id\": 0, \"address\": \"0x40\"}, \"id\": 8, \"channel\": 8, \"rotate_to_deg\": 30}, {\"init_deg\": 0, \"hat\": {\"id\": 0, \"address\": \"0x40\"}, \"id\": 10, \"channel\": 10, \"rotate_to_deg\": 22}, {\"init_deg\": 0, \"hat\": {\"id\": 0, \"address\": \"0x40\"}, \"id\": 12, \"channel\": 12, \"rotate_to_deg\": 25}]}", "latency": 0, "statusCode": 200, "label": "", "headers": [ { "key": "", "value": "" } ], "filePath": "", "sendFileAsBody": false, "rules": [], "rulesOperator": "OR", "disableTemplating": false } ], "enabled": true, "randomResponse": false }, { "uuid": "", "documentation": "", "method": "get", "endpoint": "hats/:id", "responses": [ { "uuid": "", "body": "{\"id\": 0, \"address\": \"0x40\"}", "latency": 0, "statusCode": 200, "label": "", "headers": [ { "key": "", "value": "" } ], "filePath": "", "sendFileAsBody": false, "rules": [], "rulesOperator": "OR", "disableTemplating": false }, { "uuid": "", "body": "{\"id\": 1, \"address\": \"1x40\"}", "latency": 0, "statusCode": 200, "label": "", "headers": [ { "key": "", "value": "" } ], "filePath": "", "sendFileAsBody": false, "rules": [ { "target": "params", "modifier": "id", "value": "0", "isRegex": false } ], "rulesOperator": "OR", "disableTemplating": false } ], "enabled": true, "randomResponse": false }, { "uuid": "", "documentation": "", "method": "get", "endpoint": "servos/:id", "responses": [ { "uuid": "", "body": "No param", "latency": 0, "statusCode": 200, "label": "", "headers": [ { "key": "", "value": "" } ], "filePath": "", "sendFileAsBody": false, "rules": [], "rulesOperator": "OR", "disableTemplating": false }, { "uuid": "", "body": "{\"init_deg\": 0, \"hat\": {\"id\": 0, \"address\": \"0x40\"}, \"id\": 2, \"channel\": 2, \"rotate_to_deg\": 40}", "latency": 0, "statusCode": 200, "label": "", "headers": [ { "key": "", "value": "" } ], "filePath": "", "sendFileAsBody": false, "rules": [ { "target": "params", "modifier": "id", "value": "2", "isRegex": false } ], "rulesOperator": "OR", "disableTemplating": false } ], "enabled": true, "randomResponse": false }, { "uuid": "", "documentation": "", "method": "get", "endpoint": "records", "responses": [ { "uuid": "", "body": "{\"records\": [\"AMAN 1 101017\", \"WP43_44\", \"TEA CEREMONY PART 2 17117\", \"GrigoryNikulinThursOct6\", \"TEA CEREMONY 171117\", \"FREE CONVERSATION 2 251017\", \"Jennifer WestThursdayOct6\", \"BELLY DANCING 081017\", \"WP23_31\", \"BOUNCE AND RHYME 101017\", \"CHILDREANS CRAFT WORKSHOP EXETER LIBRARY231017\", \"WP33\", \"Reporting\", \"FinalRemarks\", \"carlo_introduction\", \"BOUNCE AND RHYME 2 101017\", \"Anthos Arts Craft workshop 211017\"]}", "latency": 0, "statusCode": 200, "label": "", "headers": [ { "key": "", "value": "" } ], "filePath": "", "sendFileAsBody": false, "rules": [], "rulesOperator": "OR", "disableTemplating": false } ], "enabled": true, "randomResponse": false }, { "uuid": "", "documentation": "", "method": "get", "endpoint": "records/:name", "responses": [ { "uuid": "", "body": "not found", "latency": 0, "statusCode": 200, "label": "", "headers": [ { "key": "", "value": "" } ], "filePath": "", "sendFileAsBody": false, "rules": [], "rulesOperator": "OR", "disableTemplating": false }, { "uuid": "", "body": "", "latency": 0, "statusCode": 200, "label": "", "headers": [ { "key": "", "value": "" } ], "filePath": "/home/katja/workstuff/WebProjects/Bellhouse/master-pi-server-code/records/all_bells.json", "sendFileAsBody": true, "rules": [ { "target": "params", "modifier": "name", "value": "all_bells", "isRegex": false } ], "rulesOperator": "OR", "disableTemplating": false }, { "uuid": "", "body": "{}", "latency": 0, "statusCode": 200, "label": "", "headers": [ { "key": "", "value": "" } ], "filePath": "/home/katja/workstuff/WebProjects/Bellhouse/master-pi-server-code/records/AMANDA 1 101017.json", "sendFileAsBody": true, "rules": [ { "target": "params", "modifier": "name", "value": "amanda", "isRegex": false } ], "rulesOperator": "OR", "disableTemplating": false }, { "uuid": "", "body": "{}", "latency": 0, "statusCode": 200, "label": "", "headers": [ { "key": "", "value": "" } ], "filePath": "/home/katja/workstuff/WebProjects/Bellhouse/master-pi-server-code/records/Andrea Taylor.json", "sendFileAsBody": true, "rules": [ { "target": "params", "modifier": "name", "value": "andrea", "isRegex": false } ], "rulesOperator": "OR", "disableTemplating": false } ], "enabled": true, "randomResponse": false } ], "proxyMode": false, "proxyHost": "", "https": false, "cors": true, "headers": [ { "key": "Content-Type", "value": "application/json" }, { "key": "Access-Control-Allow-Origin", "value": "*" }, { "key": "Access-Control-Allow-Methods", "value": "GET,POST,PUT,PATCH,DELETE,HEAD,OPTIONS" }, { "key": "Access-Control-Allow-Headers", "value": "Content-Type, Origin, Accept, Authorization, Content-Length, X-Requested-With" } ], "proxyReqHeaders": [ { "key": "", "value": "" } ], "proxyResHeaders": [ { "key": "", "value": "" } ] } } ] }

katjam commented 3 years ago

config json export https://github.com/TheBellhouse/config/issues/5#issuecomment-823872590