forked from brunnolou/Cockpit-Real-time-Server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.