{"_id":"@actyx-contrib/actyx-http-connector","_rev":"5-9ef29a2f37271f4f6e26f4ea5bb52372","name":"@actyx-contrib/actyx-http-connector","dist-tags":{"latest":"1.0.2"},"versions":{"0.1.0":{"name":"@actyx-contrib/actyx-http-connector","version":"0.1.0","description":"Rest or WS interface to interconnect to actyx","main":"./lib/index.js","types":"./lib/index.d.ts","scripts":{"prepack":"npm run build:doc && npm run build","clean":"rimraf ./lib ./coverage ./dist ./.cache","tsc":"tsc","tsc:watch":"tsc --watch --pretty","build":"tsc -p ./tsconfig.json","build:watch":"rimraf ./lib && npm run build -- --watch --pretty","build:doc":"rimraf ./docs && typedoc --options typedoc.json","lint":"tsc & eslint './src/**/*.{js,ts,tsx}' & prettier './src/**/*.{js,ts,tsx}' --check","lint:fix":"tsc & eslint './src/**/*.{js,ts,tsx}' --fix & prettier './src/**/*.{js,ts,tsx}' --write","license:add":"license-check-and-add add -f add-license-config.json","license:check":"license-check-and-add check -f add-license-config.json","license:check-dep":"license-checker --production --onlyAllow 'MIT; MIT OR X11; BSD; ISC; Apache-2.0;'","example:simple":"ts-node example/simple/server.ts & parcel example/simple/client.html","example:advanced":"ts-node example/advanced/server.ts & parcel example/advanced/client.html"},"repository":{"type":"git","url":"github.com:actyx-contrib/actyx-http-connector"},"keywords":["actyx","http","rest","WebSocket","actyxOS","distributed","local-first"],"author":{"name":"Alex Halemba"},"license":"Apache-2.0","peerDependencies":{"@actyx/pond":"2"},"dependencies":{"body-parser":"^1.19.0","cors":"^2.8.5","express":"^4.17.1","express-ws":"^4.0.0"},"devDependencies":{"@actyx/pond":"^2.2.0","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/deep-equal":"^1.0.1","@types/express":"^4.17.11","@types/express-ws":"^3.0.0","@types/react":"^16.9.43","@typescript-eslint/eslint-plugin":"^2.19.2","@typescript-eslint/parser":"^2.19.2","eslint":"^6.8.0","eslint-config-prettier":"^6.9.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","license-check-and-add":"^3.0.4","parcel":"1.12.3","prettier":"^1.19.1","react":"^16.13.1","react-dom":"^16.13.1","rimraf":"^3.0.2","ts-loader":"^7.0.5","ts-node":"^9.1.1","typedoc":"^0.17.7","typescript":"^4.2.3"},"gitHead":"7ab7451cbcd65a51e759125f304e2024379dfbd7","_id":"@actyx-contrib/actyx-http-connector@0.1.0","_nodeVersion":"14.15.5","_npmVersion":"7.6.3","dist":{"integrity":"sha512-Z76oo4f8Suwu+Xl3ROtSOikmFHFGSBQ/sSbbfQu9tCbwV1L8+Zvm0iAQBj73cxH/gkXY4wz0BVyDuIrU2T9i0w==","shasum":"ad760f376d82ee35e9f7a47caa38234d7752e7ec","tarball":"https://registry.npmjs.org/@actyx-contrib/actyx-http-connector/-/actyx-http-connector-0.1.0.tgz","fileCount":6,"unpackedSize":37485,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgW4/kCRA9TVsSAnZWagAADFcP/iaiseimwPMMh82GRsh5\nH6JdWzSospxFbJlo35d72p5vh2wgh2lBd8kKSxdMuW8Bq1cADY/AFi+o6V+F\nT965JDZgy2g9SgIAsxEzuS5prBdvwadhStEQ8VopgWsuJU1Jg5hgcjBw3Rci\nYrJEy0KrK6RzayCp+aePod/kdNHlwFl+NquIBEHdMzpHUFVunw+f8kxIi82F\nEBZWohMkJBCoS9T5poUCp4AFpAFeG+7wbmRL/1n4ci4gDRMTLh10YLhY8fRe\nCXy4gaIODHuSUWz8TWJfOt9Pn6FQBU/dkze8yygh4ewf0N7aRGS0D0ORd4gT\noKWJGyR5GJAWKCwD5vZJgfxNe1OxKBPaOML42CtR6uxJSntmjBglP5PCwGqF\n7I5oQEtB/2dgOhrpdpWzas2Ef1sLCyDy75KadpKMGleJk7CPtIMPSGROnO+v\nkIxHGfKU+STf/AHJNj0UqTdU3CCIH20oyLf0X5SIi9Hc6XZomwWdAdSao4sV\n2JCMpqYVPgf3YW4gqVWMMtlnsRrMs2vy+1fT5L+CmxIn8GNKf/jnr57I0k8s\nqd5qcjtp74KajPociT8c2OudOYMkpwxGKrctO7HqXhPQkulzlNR2yZ2wH6u9\nzP7XV+OVGRQXX6tL9Cs8wTH/MGECZYVRT0EW4DjPRBDJeCtOTC15s8jjsC7f\n6eKc\r\n=e7Vc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEt2evaVJEYHgV0h5jF9qTrrbkuvenVxnOKE2w0Y00OhAiB00/9yS9wNCPIBka/xHc/wxy3zP/pStyozPt1OeOzIcw=="}]},"_npmUser":{"name":"alex(actyx)","email":"alex.halemba@actyx.io"},"directories":{},"maintainers":[{"name":"alex(actyx)","email":"alex.halemba@actyx.io"},{"name":"ostollmann","email":"oliver@alithia.net"},{"name":"roland.kuhn","email":"roland@actyx.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/actyx-http-connector_0.1.0_1616613347998_0.8786917701241437"},"_hasShrinkwrap":false},"1.0.0":{"name":"@actyx-contrib/actyx-http-connector","version":"1.0.0","description":"REST or WS interface to interconnect to actyx","main":"./lib/index.js","types":"./lib/index.d.ts","scripts":{"test":"TZ=UTC jest --forceExit --config ./jest-config.js","test:watch":"TZ=UTC jest --watch --config ./jest-config.js","prepack":"npm run build:doc && npm run build","clean":"rimraf ./lib ./coverage ./dist ./.cache","tsc":"tsc","tsc:watch":"tsc --watch --pretty","build":"tsc -p ./tsconfig.json","build:watch":"rimraf ./lib && npm run build -- --watch --pretty","build:doc":"rimraf ./docs && typedoc --options typedoc.json","lint":"tsc & eslint './src/**/*.{js,ts,tsx}' & prettier './src/**/*.{js,ts,tsx}' --check","lint:fix":"tsc & eslint './src/**/*.{js,ts,tsx}' --fix & prettier './src/**/*.{js,ts,tsx}' --write","license:add":"license-check-and-add add -f add-license-config.json","license:check":"license-check-and-add check -f add-license-config.json","license:check-dep":"license-checker --production --onlyAllow 'MIT; MIT OR X11; BSD; ISC; Apache-2.0;' --excludePackages '@actyx/sdk@0.1.2;@actyx/pond@3.0.1;'","examples:build":"npm run example:simple:build && npm run example:advanced:build","example:simple":"ts-node example/simple/server.ts & parcel example/simple/client.html","example:simple:build":"tsc --esModuleInterop --moduleResolution node --lib dom,es5,es6 example/simple/server.ts && parcel build example/simple/client.html --out-dir=./dist/simple","example:advanced":"ts-node example/advanced/server.ts & parcel example/advanced/client.html","example:advanced:build":"tsc --esModuleInterop --moduleResolution node --lib dom,es5,es6 example/advanced/server.ts && parcel build example/advanced/client.html --out-dir=./dist/advanced"},"repository":{"type":"git","url":"git+https://github.com/actyx-contrib/actyx-http-connector.git"},"keywords":["actyx","http","rest","WebSocket","actyxOS","distributed","local-first"],"author":{"name":"Alex Halemba"},"license":"Apache-2.0","peerDependencies":{"@actyx/pond":">1"},"dependencies":{"axios":"^0.21.1","body-parser":"^1.19.0","cors":"^2.8.5","express":"^4.17.1","express-ws":"^4.0.0"},"devDependencies":{"@actyx/pond":"^3.0.1","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/deep-equal":"^1.0.1","@types/express":"^4.17.11","@types/express-ws":"^3.0.0","@types/jest":"^26.0.21","@types/react":"^16.9.43","@typescript-eslint/eslint-plugin":"^2.19.2","@typescript-eslint/parser":"^2.19.2","eslint":"^6.8.0","eslint-config-prettier":"^6.9.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","jest":"^26.6.3","license-check-and-add":"^3.0.4","license-checker":"25.0.1","parcel":"1.12.3","prettier":"^1.19.1","react":"^16.13.1","react-dom":"^16.13.1","rimraf":"^3.0.2","ts-jest":"^26.5.4","ts-loader":"^7.0.5","ts-node":"^9.1.1","typedoc":"^0.17.7","typescript":"^4.2.3"},"gitHead":"8ec7740150bf7821cf7ba6391febf3cd98e22cd1","bugs":{"url":"https://github.com/actyx-contrib/actyx-http-connector/issues"},"homepage":"https://github.com/actyx-contrib/actyx-http-connector#readme","_id":"@actyx-contrib/actyx-http-connector@1.0.0","_nodeVersion":"14.15.5","_npmVersion":"7.19.1","dist":{"integrity":"sha512-21/rwg+8fDi1zHuAM2CPmJWwAHGBtQ24cKrNbnhSNGSymfuGIXfIciccAJftCge5h8jYdEXb4gWNbTisu6f1rQ==","shasum":"e39d3bc54e492be56fbc87d6d03a562d7e80ffaf","tarball":"https://registry.npmjs.org/@actyx-contrib/actyx-http-connector/-/actyx-http-connector-1.0.0.tgz","fileCount":7,"unpackedSize":61351,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg4y+nCRA9TVsSAnZWagAAAMgP/2A6eUAGlb8fmGK12/B8\nIeqwJMsG/npRwiTJGGAArcBs4doVblGmGiCUvjAKEMNrIPPND4w8e7YtEWoT\nOrFAkRP/X5pUHJcVJYq/xCBmsnOrv87ZnzAiwhpmJFdXOpi4tRAyzvsXmtwJ\nqp8ymXlUkN8YqBbT1XMQr+N1h54aTkFaSV/7d0H6/n0RITDyx0j+vbG6uRbQ\nw1saQkzesAunC+m715fzxbnTY5L1cA9aPjPzk1vcxg+xO6kpkuGr7VpvsPej\ne+wNyknqxW2yffpcjqPD4fZCC69RCNcnXaWpqnD9b6toWxvUzEMAQWELcq2s\n6iq/xs0jShKK100//ZbcTHnq8E+5VFeT4UtrcMEn8PxcA82qtK8FAMJ0ZDio\nkUeykxBU8i86x35Pnl5ZaX0wP9Rly7lBdYQcmtagSikKIOsOJZ1T6RRhTuWp\n1ZJEGYqw/vVW3xKk6NUcjkH26QmB/62pLsBJF05C4G94EdU0LEMpYMqv2H10\n3hrP2fc+MMM2ybfzVv9bT4xgmrpBKDzfdzALCUe8KPrfSenimZT6gmnlfBij\n1/YVkNDbAuFr4b0QBnE39TazozJXP0UxiL01v8uQjrq3WDAA6yryZuZg6hth\n3vTgqpXUn62OzQyCEQ9QeEaU7YcgjwbQtVWBE2UwRoA1MW0XuubwwAOfzOer\nDq+C\r\n=2RLt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAPMIBhxLjkx7eTsiowhBMbyrKYdDmRlpw1x0VRGCTLiAiEAyARRgrwvWyWrydxVlxTZO6iVkLxRu0BPU6fBFKYmvUk="}]},"_npmUser":{"name":"alex(actyx)","email":"alex.halemba@actyx.io"},"directories":{},"maintainers":[{"name":"alex(actyx)","email":"alex.halemba@actyx.io"},{"name":"ostollmann","email":"oliver@alithia.net"},{"name":"roland.kuhn","email":"roland@actyx.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/actyx-http-connector_1.0.0_1625501606565_0.9786455362648772"},"_hasShrinkwrap":false},"1.0.2":{"name":"@actyx-contrib/actyx-http-connector","version":"1.0.2","description":"REST or WS interface to interconnect to actyx","main":"./lib/src/index.js","types":"./lib/src/index.d.ts","scripts":{"test":"TZ=UTC jest --forceExit --config ./jest-config.js","test:watch":"TZ=UTC jest --watch --config ./jest-config.js","prepack":"npm run clean && npm run build:doc && npm run build","clean":"rimraf ./lib ./coverage ./dist ./.cache","tsc":"tsc","tsc:watch":"tsc --watch --pretty","build":"tsc -p ./tsconfig.json","build:watch":"rimraf ./lib && npm run build -- --watch --pretty","build:doc":"rimraf ./docs && typedoc --options typedoc.json","lint":"tsc & eslint './src/**/*.{js,ts,tsx}' & prettier './src/**/*.{js,ts,tsx}' --check","lint:fix":"tsc & eslint './src/**/*.{js,ts,tsx}' --fix & prettier './src/**/*.{js,ts,tsx}' --write","license:add":"license-check-and-add add -f add-license-config.json","license:check":"license-check-and-add check -f add-license-config.json","license:check-dep":"license-checker --production --onlyAllow 'MIT; MIT OR X11; BSD; ISC; Apache-2.0;' --excludePackages '@actyx/sdk@0.1.2;@actyx/pond@3.0.1;'","examples:build":"npm run example:simple:build && npm run example:advanced:build","example:simple":"ts-node example/simple/server.ts & parcel example/simple/client.html","example:simple:build":"tsc --esModuleInterop --moduleResolution node --lib dom,es5,es6 example/simple/server.ts && parcel build example/simple/client.html --out-dir=./dist/simple","example:advanced":"ts-node example/advanced/server.ts & parcel example/advanced/client.html","example:advanced:build":"tsc --esModuleInterop --moduleResolution node --lib dom,es5,es6 example/advanced/server.ts && parcel build example/advanced/client.html --out-dir=./dist/advanced"},"repository":{"type":"git","url":"git+https://github.com/actyx-contrib/actyx-http-connector.git"},"keywords":["actyx","http","rest","WebSocket","actyxOS","distributed","local-first"],"author":{"name":"Alex Halemba"},"license":"Apache-2.0","peerDependencies":{"@actyx/pond":">1"},"dependencies":{"axios":"^0.21.1","body-parser":"^1.19.0","cors":"^2.8.5","express":"^4.17.1","express-ws":"^4.0.0"},"devDependencies":{"@actyx/pond":"^3.0.1","@types/body-parser":"^1.19.0","@types/cors":"^2.8.10","@types/deep-equal":"^1.0.1","@types/express":"^4.17.11","@types/express-ws":"^3.0.0","@types/jest":"^26.0.21","@types/react":"^16.9.43","@typescript-eslint/eslint-plugin":"^2.19.2","@typescript-eslint/parser":"^2.19.2","eslint":"^6.8.0","eslint-config-prettier":"^6.9.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","jest":"^26.6.3","license-check-and-add":"^3.0.4","license-checker":"25.0.1","parcel":"1.12.3","prettier":"^1.19.1","react":"^16.13.1","react-dom":"^16.13.1","rimraf":"^3.0.2","ts-jest":"^26.5.4","ts-loader":"^7.0.5","ts-node":"^9.1.1","typedoc":"^0.17.7","typescript":"^4.2.3"},"gitHead":"8648254068d8983ebb7722dc3603412e6086d9f9","bugs":{"url":"https://github.com/actyx-contrib/actyx-http-connector/issues"},"homepage":"https://github.com/actyx-contrib/actyx-http-connector#readme","_id":"@actyx-contrib/actyx-http-connector@1.0.2","_nodeVersion":"14.15.5","_npmVersion":"7.19.1","dist":{"integrity":"sha512-Cuf7ZZcboUyhzU2D2kdvZTY1/bYO7zxkQp6kPo5d8rHrSOy9HSmk4cTb8CSABgcds+AWPhYFpE2PfAT6jWXHhw==","shasum":"e360fda4262e30c1fe87358c7323447c0243f3a0","tarball":"https://registry.npmjs.org/@actyx-contrib/actyx-http-connector/-/actyx-http-connector-1.0.2.tgz","fileCount":11,"unpackedSize":55537,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7ACqCRA9TVsSAnZWagAA0kgP/1TFFVWDKsmToWvIly0H\nzVEk76+Kusld6XMWFO54Le3ghns97eH3C5hvSk8iLae/0C/mLo+F/NaJZP4M\ncFQNmDuBD1syNBOWEVPElHXZl5MpapHZhog3ILjQmD2Lanu6kSUmK/x303wG\nK7NHYcFd2AIzX77pbidyEevqM2m4yt+Skcz6IuAlan6plb3ivF4OOUUbGpMY\nF/8Lm3GsNejU6tRaRrj1d6d1MFbw/n2LZtik4nPTxXKUjN5eGYj9OyW7rfCe\nMR5+lekEQSCGYOv8l9JoaikNJwxIVe7rkVQmu4Yy3E5TPIl+7+gh0AAS0rLt\nTFxjtbeE3B3FzIInRxE0/YdIykCBUkK75YOf3u500I8qp7b0szQ7ssx/dtQ6\np2lR++/LQV2l3Z/R4N5hVnuDoeerDfg0Y8jlvi2EuznXeyTiooWVJs6ocx5/\nZfBLjNh9zliFnpFD6kpBriYTECsxaBOr1TG9Pbbs//M/ephXbMRnVpIipvS2\ne/fIoBF/7O/9g6i8ZZyVik9zRMpnqU8iYYoCX69u0KZ8EMn0hlUe39RLVzJk\nH/EsNMS/8Aro+mxrpopcp44BmrS7XjDe+x/UfFk0KxDJJeFwXedJomEA1+x1\ngernYf8qfqWjAQrUcQsESlDcC+U671eyIdFdNUB9Qa6smxVCfKyW7ojTL5H2\nkLdu\r\n=I0T8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCb0OSVUJ2vNzwkydil+lQCTZ8lGziP5N6qivJI4QwnbAIhAPl7B+9Vw23WfVDEqsnVNyrOVOQlvkhn58zmGxsUWTo6"}]},"_npmUser":{"name":"alex(actyx)","email":"alex.halemba@actyx.io"},"directories":{},"maintainers":[{"name":"alex(actyx)","email":"alex.halemba@actyx.io"},{"name":"ostollmann","email":"oliver@alithia.net"},{"name":"roland.kuhn","email":"roland@actyx.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/actyx-http-connector_1.0.2_1626079402140_0.9505706988120561"},"_hasShrinkwrap":false}},"time":{"created":"2021-03-24T19:15:47.787Z","0.1.0":"2021-03-24T19:15:48.180Z","modified":"2022-04-04T11:20:22.727Z","1.0.0":"2021-07-05T16:13:26.716Z","1.0.1":"2021-07-12T08:28:52.659Z","1.0.2":"2021-07-12T08:43:22.285Z"},"maintainers":[{"name":"alex(actyx)","email":"alex.halemba@actyx.io"},{"name":"ostollmann","email":"oliver@alithia.net"},{"name":"roland.kuhn","email":"roland@actyx.io"}],"description":"REST or WS interface to interconnect to actyx","keywords":["actyx","http","rest","WebSocket","actyxOS","distributed","local-first"],"repository":{"type":"git","url":"git+https://github.com/actyx-contrib/actyx-http-connector.git"},"author":{"name":"Alex Halemba"},"license":"Apache-2.0","readme":"<img width=\"130px\" src=\"https://raw.githubusercontent.com/actyx-contrib/actyx-HTTP-Connector/master/icon.png?token=AATHWQIC5RWS62GY3OINH3C645MHQ\">\n\n# Actyx-HTTP-Connector\n\nNeed a connector to talk to an Actyx swarm from external applications via HTTP?\n\n`Actyx-HTTP-Connector` allows you to build one in a few minutes while keeping the embedded HTTP server fully customizable.\n\n## ✨ Features\n\nThe HTTP connector allows you to interact with a swarm of Actyx nodes by providing an HTTP interface to systems not running Actyx.\nYou can use it to ...\n\n- ... inject data from other systems that will be injected into the Actyx swarm in the form of events (think webhooks)\n- ... query [Fish](https://developer.actyx.com/docs/pond/guides/hello-world) state from non-Actyx applications to show data from Actyx in other apps (e.g. legacy web apps)\n- ... get updates from the Actyx swarm via WebSockets\n\nThe connector provides hooks you can use to influence the behavior of the underlying HTTP server/web framework, [Express](https://expressjs.com/). You can use these hooks to ...\n\n- ... add middleware like encryption, body-parsers or authentication\n- ... add static file resources\n- ... provide additional routes or catch-all route handlers\n\nAdditionally, you can query information like your local source ID, the [Pond](https://developer.actyx.com/docs/pond/introduction/ state, and whether the node running the HTTP connector is in sync with the swarm to be able to deal with error conditions better.\n\n## ⚖️ Trade-Offs\n\nNote, however, that web apps running on the HTTP connector do not provide the same level of resilience that Actyx apps do.\n\nThis is typically not an issue when interfacing with external systems (top floor, back office). But you should probably not use it to build applications that run on the shop floor and need to be highly available and resilient.\n\n## 📦 Installation\n\n`Actyx-HTTP-Connector` is available as an [npm package](https://www.npmjs.com/package/@actyx-contrib/actyx-http-connector).\n\n```shell\nnpm install @actyx-contrib/actyx-http-connector\n```\n\n# 📖 Documentation\n\nThe complete API documentation and related examples are available at [https://actyx-contrib.github.io/actyx-HTTP-Connector](https://actyx-contrib.github.io/actyx-http-connector/)\n\n# Detailed Examples\n\nYou can find sample applications [on GitHub](https://github.com/actyx-contrib/actyx-http-connector/tree/master/example).\n\nThe `simple` example exposes the possibility to query Fish state and emit events to the Pond directly. The `advanced` example adds WebSocket communication, uses event emitters and adds authentication. Both projects come with a simple [React](https://reactjs.org/) based app. Note that these apps do _not_ directly talk to an Actyx node but interface through the HTTP connector.\n\nMake sure you have an Axtyx node running on your machine before starting the examples. You can get the binaries from [our download site](https://downloads.actyx.com/).\n\nYou can start the examples using `npm i && npm run example:simple` or `npm i && npm run example:advanced`, respectively. The apps are accessible at http://localhost:1234. If that port is already allocated, the build picks another one at random. Check the build's console output to be sure.\n\n# 🤓 Quick start\n\nTo have access to your Actyx Fish definitions and the Pond, it is best to create your HTTP server as part of an (probably already existing) [axp](https://github.com/actyx-contrib/actyx-project-cli) project.\n\n```sh\n$ cd <my project folder>\n$ axp init # only if you do not already have an Actyx project in place\n$ axp add node --appName http-api\n$ npm install @actyx-contrib/actyx-http-connector --save\n```\n\n## 🔌 Add `httpConnector`\n\nIn your `http-api` app's `index.ts`, import the HTTP connector, then use `httpConnector()` to create a server instance as shown below.\nFor further details, please refer to the docs and the examples.\n\n```ts\nimport { httpConnector, registryEntry } from '@actyx-contrib/actyx-http-connector'\nimport { Pond } from '@actyx/pond'\n\nPond.default().then(pond => {\n  httpConnector({\n    // The pond instance is required for the HTTP-Connector\n    pond,\n    // Allows the user of the HTTP-Connector to emit events directly into actyx.\n    // It is not recommended to use this feature.\n    // Please use `eventEmitters` or at least add an authentication with `preSetup`\n    allowEmit: true,\n    // Propagate which fish you like to access from external programs.\n    // The fish will be published over the HTTP get request or can be observed with the websocket\n    registry: { someFish: registryEntry(SomeFish.of) },\n  })\n```\n\n# 🤓 Examples\n\n## Minimal example\n\nThe minimal example simply allows you to emit events directly into actyx using an HTTP API.\n\n```ts\nimport { httpConnector, registryEntry } from '../../src'\nimport { Pond } from '@actyx/pond'\n// Api Server\nPond.default().then(pond => {\n  httpConnector({\n    // The pond instance is required for the HTTP-Connector\n    pond,\n    // Allows the user of the HTTP-Connector to emit events directly into actyx.\n    // It is not recommended to use this feature.\n    // Please use `eventEmitters` or at least add an authentication with `preSetup`\n    allowEmit: true,\n    // Propagate which fish you like to access from external programs.\n    // The fish will be published over the HTTP get request or can be observed with the websocket\n    registry: { someFish: registryEntry(SomeFish.of) },\n  })\n})\n```\n\n## Complete example\n\nThe complete example shows also shows how to hook in middlewares and the usage of event emitters.\n\n```typescript\nimport { httpConnector, registryEntry } from '../../src'\nimport { Pond } from '@actyx/pond'\n// Api Server\nPond.default().then(pond => {\n  httpConnector({\n    // The pond instance is required for the HTTP-Connector\n    pond,\n    // Propagate which fish you like to access from external programs.\n    // The fish will be published over the HTTP get request or can be observed with the websocket\n    registry: {\n      someFish: registryEntry(SomeFish.of),\n    },\n    // Add event emitters.\n    // This methode is much safer than the `allowEmit: true`, you are in control which event\n    // are emitted and you can verify the event with TypeScript or io-TS\n    eventEmitters: {\n      startSomeFish: async (pond, _payload) => {\n        await SomeFish.emitStart(pond)\n        return EmitResult.reply(204)\n      },\n    },\n    // Add the authentication layer before the routes are created.\n    // this hook is added after urlencoded, json, cors, you could add XML parser,\n    // cookie parser and other middleware you like\n    preSetup: app => {\n      app.use(xmlparser())\n      // add Authentication\n    },\n    // Add a handler after the routes are added to express.\n    // This could be used for a default \"404 not-Found\" page or a redirect to your documentation\n    postSetup: app => {\n      app.use((_req, res, _next) => res.redirect('https://community.actyx.com'))\n    },\n  })\n})\n```\n","readmeFilename":"README.md","homepage":"https://github.com/actyx-contrib/actyx-http-connector#readme","bugs":{"url":"https://github.com/actyx-contrib/actyx-http-connector/issues"}}