@mercuryworkshop/wisp-js
Advanced tools
Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "@mercuryworkshop/wisp-js", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "A client and server for the Wisp protocol, written in Javascript", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -85,9 +85,30 @@ # JavaScript Wisp Client | ||
### Example With Express: | ||
```js | ||
import { server as wisp } from "@mercuryworkshop/wisp-js/server"; | ||
import express from "express"; | ||
import morgan from "morgan"; | ||
const app = express(); | ||
const port = process.env.PORT || 5001; | ||
app.use(morgan("combined")); | ||
app.use(express.static("./")); | ||
const server = app.listen(port, () => { | ||
console.log("Listening on port: ", port) | ||
}); | ||
server.on("upgrade", (request, socket, head) => { | ||
wisp.routeRequest(request, socket, head); | ||
}); | ||
``` | ||
### Change the Log Level: | ||
By default, all info messages are shown. You can change this by importing `logging` from the module, and setting its `level` property to one of the available log levels: | ||
- `logging.level = logging.DEBUG` | ||
- `logging.level = logging.INFO` (default) | ||
- `logging.level = logging.WARN` | ||
- `logging.level = logging.ERROR` | ||
- `logging.level = logging.NONE` | ||
By default, all info messages are shown. You can change this by importing `logging` from the module, and calling `logging.set_level` to set it to one of the following values: | ||
- `logging.DEBUG` | ||
- `logging.INFO` (default) | ||
- `logging.WARN` | ||
- `logging.ERROR` | ||
- `logging.NONE` | ||
@@ -97,3 +118,3 @@ ```js | ||
logging.level = logging.DEBUG; | ||
logging.set_level(logging.DEBUG); | ||
``` | ||
@@ -100,0 +121,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
77934
1162
172