Compare commits

...

2 Commits

Author SHA1 Message Date
Bevan Hunt 7228360a4c remove demo from readme 2020-03-18 13:57:18 -07:00
Bevan Hunt 318ed65344 update 2020-03-18 13:56:27 -07:00
4 changed files with 10 additions and 14 deletions

2
Cargo.lock generated
View File

@ -121,7 +121,7 @@ dependencies = [
[[package]] [[package]]
name = "broker" name = "broker"
version = "4.3.2" version = "4.3.3"
dependencies = [ dependencies = [
"Inflector 0.11.4 (registry+https://github.com/rust-lang/crates.io-index)", "Inflector 0.11.4 (registry+https://github.com/rust-lang/crates.io-index)",
"bcrypt 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "bcrypt 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",

View File

@ -1,6 +1,6 @@
[package] [package]
name = "broker" name = "broker"
version = "4.3.2" version = "4.3.3"
authors = ["Bevan Hunt <bevan@bevanhunt.com>"] authors = ["Bevan Hunt <bevan@bevanhunt.com>"]
edition = "2018" edition = "2018"
license = "MIT" license = "MIT"

View File

@ -28,10 +28,6 @@ Broker follows an insert-only/publish/subscribe paradigm rather than a REST CRUD
* Event log via GET request * Event log via GET request
* Event cancellation via GET request * Event cancellation via GET request
### Demo
[Demo](https://broker.apibill.me/)
### How it works ### How it works
In Broker you create a user, login, then insert an event with its data, a collection_id, and a timestamp. Broker publishes the event when the timestamp is reached to the event stream via SSE. Broker keeps all events its database that can be viewed in collections (by collection_id). Broker can also cancel future events. In Broker you create a user, login, then insert an event with its data, a collection_id, and a timestamp. Broker publishes the event when the timestamp is reached to the event stream via SSE. Broker keeps all events its database that can be viewed in collections (by collection_id). Broker can also cancel future events.

View File

@ -18,7 +18,7 @@ function Insert(props) {
const onSubmit = values => { const onSubmit = values => {
const apiEndpoint = process.env.REACT_APP_API + '/insert'; const apiEndpoint = process.env.REACT_APP_API + '/insert';
const vals = JSON.stringify(values); const vals = JSON.stringify(values);
const v = `{"collection_id": "${id}", "event": "demo", "timestamp": ${stamp}, "data": ${vals} }`; const v = `{"collection_id": "${id}", "event": "covid", "timestamp": ${stamp}, "data": ${vals} }`;
fetch(apiEndpoint, { fetch(apiEndpoint, {
method: 'post', method: 'post',
mode: 'cors', mode: 'cors',
@ -40,8 +40,8 @@ function Insert(props) {
<div class="md:w-2/3"> <div class="md:w-2/3">
<input <input
ref={register} ref={register}
name="client_name" name="Username"
placeholder="Client's Full Name" placeholder="Username"
class="bg-gray-200 appearance-none border-2 border-gray-200 rounded w-full py-2 px-4 text-gray-700 leading-tight focus:outline-none focus:bg-white focus:border-purple-500" class="bg-gray-200 appearance-none border-2 border-gray-200 rounded w-full py-2 px-4 text-gray-700 leading-tight focus:outline-none focus:bg-white focus:border-purple-500"
/> />
</div> </div>
@ -50,8 +50,8 @@ function Insert(props) {
<div class="md:w-2/3"> <div class="md:w-2/3">
<input <input
ref={register} ref={register}
name="client_phone_number" name="message"
placeholder="Client's Phone #" placeholder="Message"
class="bg-gray-200 appearance-none border-2 border-gray-200 rounded w-full py-2 px-4 text-gray-700 leading-tight focus:outline-none focus:bg-white focus:border-purple-500" class="bg-gray-200 appearance-none border-2 border-gray-200 rounded w-full py-2 px-4 text-gray-700 leading-tight focus:outline-none focus:bg-white focus:border-purple-500"
/> />
</div> </div>
@ -60,8 +60,8 @@ function Insert(props) {
<div class="md:w-2/3"> <div class="md:w-2/3">
<input <input
ref={register} ref={register}
name="client_email" name="location"
placeholder="Client's Email" placeholder="Location"
class="bg-gray-200 appearance-none border-2 border-gray-200 rounded w-full py-2 px-4 text-gray-700 leading-tight focus:outline-none focus:bg-white focus:border-purple-500" class="bg-gray-200 appearance-none border-2 border-gray-200 rounded w-full py-2 px-4 text-gray-700 leading-tight focus:outline-none focus:bg-white focus:border-purple-500"
/> />
</div> </div>
@ -93,7 +93,7 @@ function Load(props) {
} }
{props.jwt.length > 0 && {props.jwt.length > 0 &&
<div class="mt-20 mx-20"> <div class="mt-20 mx-20">
<Grid endpoint={process.env.REACT_APP_API} eventListen={'demo'} title={'Client Info'} token={props.jwt} /> <Grid endpoint={process.env.REACT_APP_API} eventListen={'covid'} title={'Fight Covid'} token={props.jwt} />
</div> </div>
} }
</Route> </Route>