Skip to content

Commit 77514c6

Browse files
authored
Update README.md
1 parent 2528b7a commit 77514c6

File tree

1 file changed

+28
-5
lines changed

1 file changed

+28
-5
lines changed

Diff for: README.md

+28-5
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,41 @@
22

33
**Custom widget support is only available for CNCjs 1.9.10 or later versions**
44

5-
You can download a working example widget from the releases page:<br>
6-
https://github.com/cncjs/cncjs-widget-boilerplate/releases
7-
8-
![image](https://user-images.githubusercontent.com/447801/30728983-b866f4b6-9f8e-11e7-9a90-6b712344d270.png)
9-
105
## Installation
116

127
```bash
138
npm i -g npm # Upgrade NPM to the latest version
149
npm install
1510
```
1611

12+
## Development Guide
13+
14+
Create a directory under <b>src/widgets</b> and put your code in there.
15+
16+
```
17+
src/
18+
widgets/
19+
MyApp/index.js
20+
```
21+
22+
When connecting to a local development server, you can specify the "widget" query parameter within your browser to switch between widgets (e.g. `http://localhost:5000/?widget=MyApp`).
23+
24+
### Query Parameters
25+
26+
Name | Description
27+
:--- | :----------
28+
token | (Required) An authentication token to enable secure communication. The token will be automatically set by CNCjs.
29+
host | (Optional) Specifies the host to connect to. Defaults to an empty string.
30+
widget | (Optional) Specifies a folder name under 'src/widgets'. Defaults to 'ReactApp'.
31+
32+
### Examples
33+
34+
#### React App
35+
36+
There is a widget written with React, you can download it from the releases page: https://github.com/cncjs/cncjs-widget-boilerplate/releases
37+
38+
![image](https://user-images.githubusercontent.com/447801/30728983-b866f4b6-9f8e-11e7-9a90-6b712344d270.png)
39+
1740
## Development
1841

1942
Run `npm run dev` to start a local development server for development, then connect to http://localhost:5000 and wait until bundle finished.

0 commit comments

Comments
 (0)