shrub/pkg/npm/http-api
Hunter Miller b211d272d9 Publish
- @urbit/api@2.0.0
 - @urbit/http-api@2.0.0
2021-11-02 14:29:23 -05:00
..
example npm: Updated http-api and api packages 2021-04-22 07:17:39 -07:00
src Merge branch 'release/next-userspace' 2021-10-04 23:45:45 +04:00
test @urbit/http-api: fix tests 2021-07-26 10:04:26 +10:00
.gitignore npm: Updated http-api and api packages 2021-04-22 07:17:39 -07:00
babel.config.js @urbit/http-api: setup testing 2021-07-12 12:07:19 +10:00
jest.config.js @urbit/http-api: setup testing 2021-07-12 12:07:19 +10:00
package-lock.json Publish 2021-11-02 14:29:23 -05:00
package.json npm: updating package versions 2021-11-02 14:28:30 -05:00
README.md added NPM packages 2021-01-26 21:45:18 -08:00
setupEnv.js @urbit/http-api: setup testing 2021-07-12 12:07:19 +10:00
tsconfig.json @urbit/http-api: fix package configuration 2021-06-08 14:26:28 +10:00

Urbit Connector

This project allows you to connect to an Urbit ship via a JavaScript application.

Example

Check out the example directory for examples of how to use this code.

  1. Open example/index.html in your browser and follow the instructions there, or
  2. With a ship running in the same fashion as indicated in the file above, run node example/index.js

The code for either of these can be found in src/example/browser.js or src/example/node.js, depending on your context.

Design

This library is designed to be useful for node applications that communicate with an urbit running either on the local computer or on a remote one.

The majority of its methods are asynchronous and return Promises. This is due to the non-blocking nature of JavaScript. If used in a React app, response handlers should be bound with this to setState after a message is received.

NOTE

You must enable CORS requests on your urbit for this library to work in browser context. Use +cors-registry to see domains which have made requests to your urbit, and then approve the needed one, e.g. |cors-approve http://zod.arvo.network.