-
-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[new] [Example] Update, improve reference example
Improvements include: - Add button to toggle min log level on client+server - Add buttons to simulate broken connections using [#422] - General improvements to layout and text, etc.
- Loading branch information
1 parent
bfa4c72
commit 221f112
Showing
4 changed files
with
128 additions
and
57 deletions.
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 |
---|---|---|
@@ -1,8 +1,27 @@ | ||
# Official Sente reference example | ||
|
||
> This example dives into Sente's full functionality pretty quickly; it's probably more useful as a reference than a tutorial. Please see Sente's top-level README for a gentler intro. | ||
This example dives into Sente's full functionality pretty quickly; it's probably more useful as a reference than a tutorial. | ||
|
||
Please see Sente's [top-level README](https://github.com/ptaoussanis/sente) for a gentler introduction to Sente. | ||
|
||
## Instructions | ||
|
||
1. Call `lein start` at your terminal, should auto-open web browser | ||
2. Observe std-out (server log) and web page textarea (client log) | ||
### Without REPL | ||
|
||
1. Call `lein start` at your terminal. | ||
2. This will start a local HTTP server and auto-open a test page in your web browser. | ||
3. Follow the instructions from that page. | ||
|
||
### With REPL | ||
|
||
1. Call `lein start-dev` at your terminal. | ||
2. This will start a local [nREPL server](https://nrepl.org/nrepl/index.html) and print the server's details, e.g.: | ||
|
||
> nREPL server started on port 61332 on host 127.0.0.1 - nrepl://127.0.0.1:61332 | ||
2. This will start a local HTTP server and auto-open a test page in your web browser. | ||
3. Follow the instructions from that page. | ||
|
||
3. Connect your dev environment to that nREPL server, e.g. `(cider-connect)` from Emacs. | ||
4. Open the example's [`server.clj`](https://github.com/ptaoussanis/sente/blob/master/example-project/src/example/server.clj) file in your dev environment. | ||
5. Eval `(example.server/start!)` to start a local HTTP server and auto-open a test page in your web browser. | ||
6. Follow the instructions from that page. |
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
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
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