1.0.4 • Published 8 years ago

akera-rest-file v1.0.4

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

Akera Logo

REST File module for Akera.io web service - used mainly for developer studio this broker middleware service provides access to files in application server web-path.

Installation

$ npm install akera-rest-file

Docs

Quick Start

This module is designed to only be loaded as broker level service which is usually done by adding a reference to it in services section of each broker's configuration in akera-web.json configuration file.

  "brokers": [
  	{	"name": "demo",
  		"host": "localhost",
		"port": 3737,
		"services": [
			{ 
				"middleware": "akera-rest-file",
				"config": {
					"route": "/rest-file/"
				}
			}
		]
	}
  ]

Service options available: - route: the route where the service is going to be mounted (default: '/rest/file/')

The interface can then be used to access/update files on the application server's web-path by making HTTP requests:

MethodUrlFunction
GEThttp://[host]/[broker]/rest-file/pathreads file or folder content of given path
PUThttp://[host]/[broker]/rest-file/pathcreate a new file at given path, use isDir parameter with value or true to create a folder
POSThttp://[host]/[broker]/rest-file/pathupdate the file content at given path using the request body as new content
DELETEhttp://[host]/[broker]/rest-file/pathdelete the file or folder at given path

License

MIT

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago