occam-furtle 2.0.338 → 2.0.340

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -88,6 +88,25 @@ You can also clone the repository with [Git](https://git-scm.com/)...
88
88
 
89
89
  npm install
90
90
 
91
+ ## Example
92
+
93
+ There is a small development server that can be run from within the project's directory with the following command:
94
+
95
+ npm start
96
+
97
+ The example will then be available at the following URL:
98
+
99
+ http://localhost:8888
100
+
101
+ The source for the example can be found in the `src/example.js` file and corresponding `src/example` folder.
102
+ You can rebuild them on the fly with the following command:
103
+
104
+ npm run watch-debug
105
+
106
+ The development server will reload the page whenever you make changes.
107
+
108
+ One last thing to bear in mind is that this package is included by way of a relative rather than a package import. If you are importing it into your own application, however, you should use the standard package import.
109
+
91
110
  ## Building
92
111
 
93
112
  Automation is done with [npm scripts](https://docs.npmjs.com/misc/scripts), have a look at the `package.json` file. The pertinent commands are:
package/bin/main.js ADDED
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ const express = require("express");
4
+
5
+ const { createLiveReloadHandler } = require("lively-cli");
6
+
7
+ const server = express(), ///
8
+ staticRouter = express.static("."),
9
+ liveReloadHandler = createLiveReloadHandler("./example.js");
10
+
11
+ server.use(staticRouter);
12
+
13
+ server.get("/live-reload", liveReloadHandler);
14
+
15
+ server.listen(8888);