Skip to content

holochain/holochain-node-http-container

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Holochain-node-HTTP-container

An early version of a HTTP interface for holochain-rust.

Configuration

This project combines holochain-nodejs and express to allow holochain hApp functions to be called over HTTP POST.

All configuration is done via a config.json file. The HTTP container must be started with the path to a config as the argument. The config file has the following structure:

{
	"port": "3000", // use whatever port you like
	"happs": {
		"happ-Name": "path/to/hApp/hcpkg" // happ names map to the path to the hcpkg file
		...
	}
}

This allows for multiple hApps to be included and functions in each of them can be called by their name.

Usage

All happ/zome function are exposed at a single HTTP POST endpoint /call/

The post request expects a JSON body with the following format:

{
	"happ": "happ-name",
	"zome": "zome-name",
	"capability": "capability-name",
	"func": "function-name",
	"data": // any valid JSON object to be passed to the function call
}

The server can be started by running

node index.js path/to/config.js

About

An early version of a HTTP interface for holochain-rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%