// Test uibuilder v3 admin API routes // // Using REST Client extension https://github.com/Huachao/vscode-restclient#rest-client // File variables @hostname = localhost @port = 1880 @host = {{hostname}}:{{port}} @redAdminPath = red @uibPath = uibuilder @uibAdminPath = admin @contentType = application/json @createdAt = {{$datetime iso8601}} # Valid uibuilder instance URL @url = test1 # @name Sample-Get # Get something and return it GET http://{{host}}/{{redAdminPath}}/{{uibPath}}/{{uibAdminPath}}/{{url}}?ping=pong content-type: {{contentType}} { "name": "sample GET", "time": "{{createdAt}}" } ### # @name Sample-Put # Write file contents PUT http://{{host}}/{{redAdminPath}}{{uibAdminPath}}/{{url}} content-type: {{contentType}} { "name": "sample PUT", "time": "{{createdAt}}" } ### # @name Sample-Post # Create a new folder or file POST http://{{host}}/{{redAdminPath}}{{uibAdminPath}}/{{url}} content-type: {{contentType}} { "name": "sample DELETE", "time": "{{createdAt}}" } ### # @name Sample-Delete # Delete a folder or a file DELETE http://{{host}}/{{redAdminPath}}{{uibAdminPath}}/{{url}} content-type: {{contentType}} { "name": "sample DELETE", "time": "{{createdAt}}" } ### # @name Instance-Info # Returns an HTML page of info for the current instance of uibuilder GET http://{{host}}/{{redAdminPath}}{{uibAdminPath}}/instance/{{url}} content-type: {{contentType}} { "cmd": "showinstancesettings", "time": "{{createdAt}}" } ### # @name Instance-List-All-Folders-Files # Returns json list of all folders and files for the given URL (uibuilder instance) GET http://{{host}}/{{redAdminPath}}/{{uibPath}}/{{uibAdminPath}}/{{url}} content-type: {{contentType}} { "cmd": "listall", "time": "{{createdAt}}" } ### # @name List-User-Urls # Returns json list of all ExpressJS routes on the user app GET http://{{host}}/{{redAdminPath}}/{{uibPath}}/{{uibAdminPath}}/{{url}} content-type: {{contentType}} { "cmd": "listurls", "time": "{{createdAt}}" } ### # @name Check-Url-For-Duplicate # Returns json true/false. True if the given URL already exists in the list of instances or the instance folder names GET http://{{host}}/{{redAdminPath}}/{{uibPath}}/{{uibAdminPath}}/{{url}} content-type: {{contentType}} { "cmd": "checkurls", "time": "{{createdAt}}" } // NOTES: // - can send a file: `< filename.json` or (for processing variables): `<@ filename.json` // - ExpressJS supported methods are here: https://expressjs.com/en/4x/api.html#app.METHOD