Skip to content

Commit

Permalink
Add README
Browse files Browse the repository at this point in the history
  • Loading branch information
brunnolou committed Dec 28, 2017
1 parent 20c6d3a commit 732e145
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 1 deletion.
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Cockpit Real-time Server

This is a Websocket Middleware server for [Cockpit Headless CMS](https://github.com/agentejo/cockpit).

You can use the following [Javascript SDK](https://github.com/brunnolou/cockpit-sdk) to get real-time updates.

## Cockpit Webhook

Add a Webhook to Cokpit with the following settings:

* **Url**: `http://localhost:4000/update`

Or the public address where the server is hosted

* **Events**:

You must add at least one event. e.g.:

- `collections.save.after`
- `collections.save.after.portfolio`

* ![webhook screenshot](public/webhook.png)

## Preview collections
Edit each collection and add the following settings:

* **Preview URL**: _The http url where you can see the changes_.
* **Websocket**: `ws://localhost:4000/`

- ![webhook screenshot](public/preview.png)

### Installation

```sh
npm install
```

### Start

```sh
npm start
```

### Development

```sh
npm start
```

### Deployment

You can easily deploy with [Zeit Now](https://zeit.co/now)

```sh
npm deploy
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"start": "node index.js",
"dev": "nodemon index.js",
"deploy": "now rm cockpit-real-time && now --public",
"deploy": "now rm cockpit-real-time-server && now --public",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
Expand Down
Binary file added public/preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/webhook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 732e145

Please sign in to comment.