jsgui3-server 0.0.82 → 0.0.85
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 +8 -1
- package/bundler/bundle.js +11 -0
- package/bundler/bundler.js +9 -0
- package/bundler/css-bundler.js +56 -0
- package/bundler/js-bundler.js +214 -0
- package/bundler/test_ast.js +74 -0
- package/bundler/webpage-bundler.js +286 -0
- package/bundler/website-bundler.js +23 -0
- package/controls/README.md +8 -0
- package/controls/page/admin.js +75 -0
- package/controls/panel/admin.js +11 -0
- package/examples/controls/html-server-combo-box.js +5 -5
- package/examples/html-server.js +3 -0
- package/examples/square_box.js +41 -0
- package/examples/square_box_client.js +91 -0
- package/module.js +6 -0
- package/{single-control-server.js → old/_single-control-server.js} +157 -96
- package/old/single-control-server.js +108 -158
- package/{single-page-app.js → old/single-page-app.js} +2 -0
- package/{examples/demos → old}/square_box.js +1 -1
- package/package.json +9 -9
- package/page-context.js +1 -1
- package/publishing/http-css-publisher.js +0 -0
- package/publishing/{function-publisher.js → http-function-publisher.js} +11 -1
- package/publishing/http-html-page-publisher.js +5 -0
- package/publishing/http-html-publisher.js +25 -0
- package/publishing/http-jpeg-publisher.js +0 -0
- package/publishing/http-js-publisher.js +25 -0
- package/publishing/{observable-publisher.js → http-observable-publisher.js} +12 -6
- package/publishing/http-png-publisher.js +0 -0
- package/publishing/http-publisher.js +52 -0
- package/publishing/{resource-publisher.js → http-resource-publisher.js} +20 -1
- package/publishing/http-svg-publisher.js +0 -0
- package/publishing/http-webpage-publisher.js +112 -0
- package/publishing/http-website-publisher.js +271 -0
- package/publishing/notes.md +1 -0
- package/resources/README.md +16 -0
- package/resources/_old_website-resource.js +507 -0
- package/resources/compile/server-resource-compilation.js +41 -0
- package/resources/data-resource.js +8 -0
- package/resources/fs-resource.js +2 -4
- package/resources/jsbuilder/babel/deep_iterate/deep_iterate_babel.js +3 -0
- package/resources/jsbuilder/test/test_ast_node.js +1 -1
- package/resources/jsbuilder/test/test_js_file.js +2 -2
- package/resources/notes.txt +11 -0
- package/resources/server-installed-tools.js +29 -0
- package/resources/server-resource-pool.js +1 -55
- package/resources/website-css-resource.js +1 -1
- package/resources/website-javascript-resource.js +165 -34
- package/resources/website-resource.js +52 -296
- package/resources/website-static-html-resource.js +0 -1
- package/resources/website-template-html-resource.js +231 -0
- package/roadmap.md +68 -0
- package/server.js +722 -17
- package/website/webpage.js +169 -0
- package/website/website-group.js +16 -0
- package/website/website.js +253 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
const { Publisher } = require('jsgui3-html');
|
|
2
|
+
|
|
3
|
+
// Could have this as the general purpose HTTP publishing component / system / part of the system.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
// Some kind of mapping between what the response asks for and the functions to get the results along with the parameters to call them with.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class HTTP_Publisher extends Publisher {
|
|
12
|
+
constructor(spec) {
|
|
13
|
+
super(spec)
|
|
14
|
+
|
|
15
|
+
/*
|
|
16
|
+
this.handle_http = (req, res) => {
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
*/
|
|
22
|
+
}
|
|
23
|
+
handle_http(req, res) {
|
|
24
|
+
console.trace();
|
|
25
|
+
throw 'HTTP_Publisher: Use handle_http of subclass.';
|
|
26
|
+
// Determine input content type (if any)
|
|
27
|
+
// Headers, auth
|
|
28
|
+
// Then get more of a programmatic model of what it requires to be done.
|
|
29
|
+
//
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
// Use the app router to determine where the request is to go.
|
|
33
|
+
|
|
34
|
+
const do_response = () => {
|
|
35
|
+
res.writeHead(200, {
|
|
36
|
+
//'Content-Type': 'text/event-stream',
|
|
37
|
+
'Transfer-Encoding': 'chunked',
|
|
38
|
+
//'Trailer': 'Content-MD5'
|
|
39
|
+
});
|
|
40
|
+
res.write('OK\n');
|
|
41
|
+
let obs2_handler = data => {
|
|
42
|
+
//console.log('data', data);
|
|
43
|
+
let s_data = JSON.stringify(data);
|
|
44
|
+
//res.write(s_data + '\n');
|
|
45
|
+
res.write('event: message\ndata:' + s_data + '\n\n');
|
|
46
|
+
}
|
|
47
|
+
obs2.on('next', obs2_handler);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
module.exports = HTTP_Publisher;
|
|
@@ -12,11 +12,30 @@ const multiparty = require('multiparty');
|
|
|
12
12
|
// More observable systems?
|
|
13
13
|
// Making use of ofp could be very useful in various cases.
|
|
14
14
|
// mfp in some parts first?
|
|
15
|
+
const HTTP_Publisher = require('./http-publisher');
|
|
15
16
|
|
|
16
17
|
|
|
18
|
+
// For publishing a resource, implying resources don't themselves need http handling.
|
|
19
|
+
|
|
20
|
+
// maybe a handle-http js file may help that will do things in a rather general purpose way?
|
|
21
|
+
// But it more seems as though we need to set the routing. Then we could assign such handlers from the router.
|
|
22
|
+
|
|
23
|
+
// Possibly there should be a Website_Router Resource?
|
|
24
|
+
// Or a resource wrapper.
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
// Could extend a JSON_Publisher. Resource_JSON_Publisher possibly.
|
|
30
|
+
class Resource_Publisher extends HTTP_Publisher {
|
|
31
|
+
|
|
32
|
+
// Make this able to publish any resource?
|
|
33
|
+
// But I don't think this is going to publish a Website Resource as a Website.
|
|
34
|
+
// There is now the specialised HTTP_Website_Publisher.
|
|
35
|
+
|
|
17
36
|
|
|
18
|
-
class Resource_Publisher {
|
|
19
37
|
constructor(spec) {
|
|
38
|
+
super(spec);
|
|
20
39
|
this.resource = spec.resource;
|
|
21
40
|
// Don't make a new server interface by default.
|
|
22
41
|
this.name = spec.name;
|
|
File without changes
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
// A publisher handles HTTP requests.
|
|
4
|
+
|
|
5
|
+
// This is going to take over some of the responsibilities of the old website resource, which was unfocused code that was
|
|
6
|
+
// doing some of the main / most important parts of serving the website.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
const HTTP_Publisher = require('./http-publisher');
|
|
10
|
+
const {obs} = require('fnl');
|
|
11
|
+
|
|
12
|
+
// Named observables?
|
|
13
|
+
/*
|
|
14
|
+
|
|
15
|
+
obs((next, complete, error) => {
|
|
16
|
+
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
// HTTP_Webpage_Publisher could be interesting.
|
|
21
|
+
// The Website Publisher could make use of some of its functionality.
|
|
22
|
+
|
|
23
|
+
// Handling HTTP / bundling for a specific page could be cool.
|
|
24
|
+
|
|
25
|
+
// A Webpage Publisher may be simpler and better to work on in the short term.
|
|
26
|
+
// Maybe would not need to be (as) concerned with routing.
|
|
27
|
+
// Could be useful for publishing a SPA of course, kind of a website but as a single page.
|
|
28
|
+
|
|
29
|
+
// Should have more concerning bundling / compilation.
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
// There could be 'bundle' functionality for the webpage.
|
|
33
|
+
|
|
34
|
+
// The webpage itself could know what client js it needs to use.
|
|
35
|
+
|
|
36
|
+
// Seems like bundling a specified webpage earlier on in the process makes sense.
|
|
37
|
+
|
|
38
|
+
// And a Bundler as well?
|
|
39
|
+
// Perhaps HTTP_Webpage_Bundler would be an important class to have here.
|
|
40
|
+
// Considering how it could be interchangable from the publisher if it's a different class.
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class HTTP_Webpage_Publisher extends HTTP_Publisher {
|
|
45
|
+
|
|
46
|
+
// Website generally serves JS from a single address.
|
|
47
|
+
// Webpage could have its specific JS.
|
|
48
|
+
|
|
49
|
+
constructor(spec = {}) {
|
|
50
|
+
super(spec)
|
|
51
|
+
|
|
52
|
+
// A website property.
|
|
53
|
+
|
|
54
|
+
let webpage;
|
|
55
|
+
if (spec.webpage) webpage = spec.webpage;
|
|
56
|
+
Object.defineProperty(this, 'webpage', {
|
|
57
|
+
get() {
|
|
58
|
+
return webpage;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
// Probably best to come up with a bundle here, or at an early stage.
|
|
63
|
+
|
|
64
|
+
// .prepare_bundle?
|
|
65
|
+
|
|
66
|
+
// .prepare_bundle would be a good function to have here.
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
// .bundle?
|
|
71
|
+
// seems clearest that we will be getting / preparing multiple files.
|
|
72
|
+
|
|
73
|
+
// Bundling and compiling web content seems like a better thing to get working before serving (or attempting to serve) it.
|
|
74
|
+
// .build?
|
|
75
|
+
|
|
76
|
+
}
|
|
77
|
+
handle_http(req, res) {
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
// returning an observable would make sense.
|
|
81
|
+
// so other parts of the server could observe the request being processed.
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
// This may be quite concerned with ensuring the bundle before handling any http requests to provide it or parts of it.
|
|
87
|
+
// Could even unit test before running deployed code.
|
|
88
|
+
|
|
89
|
+
// Could get info on what needs to be bundled from the webpage object itself.
|
|
90
|
+
// A Webpage objects could have 'requirements', or 'build requirements'.
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
console.log('HTTP_Webpage_Publisher handle_http');
|
|
101
|
+
//console.log('req', req);
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
// May have bundle already prepared anyway.
|
|
105
|
+
// Possibly the Website or the Website_Resource could do the bundling / building.
|
|
106
|
+
// Could even bundle into a ZIP file :)
|
|
107
|
+
|
|
108
|
+
throw 'NYI';
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
module.exports = HTTP_Webpage_Publisher;
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
// A publisher handles HTTP requests.
|
|
4
|
+
|
|
5
|
+
// This is going to take over some of the responsibilities of the old website resource, which was unfocused code that was
|
|
6
|
+
// doing some of the main / most important parts of serving the website.
|
|
7
|
+
|
|
8
|
+
const {each, Router} = require('jsgui3-html');
|
|
9
|
+
const HTTP_Publisher = require('./http-publisher');
|
|
10
|
+
const {obs} = require('fnl');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
const Webpage_Bundler = require('./../bundler/webpage-bundler');
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
// Now it's the very basics of a website publisher. Quite flexible but could do with more.
|
|
17
|
+
// Better integration with bundler
|
|
18
|
+
// Rendering webpages that are dynamic and therefore not bundled (eg user specific content).
|
|
19
|
+
// Though the js could be bundled. Maybe some of the controls could be bundled? Or semi-bundled?
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
// HTTP_Webpage_Publisher could be interesting.
|
|
24
|
+
// The Website Publisher could make use of some of its functionality.
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
// Handling HTTP / bundling for a specific page could be cool.
|
|
28
|
+
|
|
29
|
+
// A Webpage Publisher may be simpler and better to work on in the short term.
|
|
30
|
+
// Maybe would not need to be (as) concerned with routing.
|
|
31
|
+
// Could be useful for publishing a SPA of course, kind of a website but as a single page.
|
|
32
|
+
|
|
33
|
+
// This seems more like the server router these days
|
|
34
|
+
// The main server router seems to pass everything to this - maybe that will change.
|
|
35
|
+
|
|
36
|
+
class HTTP_Website_Publisher extends HTTP_Publisher {
|
|
37
|
+
|
|
38
|
+
// Website generally serves JS from a single address.
|
|
39
|
+
// Webpage could have its specific JS.
|
|
40
|
+
|
|
41
|
+
constructor(spec = {}) {
|
|
42
|
+
super(spec)
|
|
43
|
+
// A website property.
|
|
44
|
+
|
|
45
|
+
let website;
|
|
46
|
+
if (spec.website) website = spec.website;
|
|
47
|
+
Object.defineProperty(this, 'website', {
|
|
48
|
+
get() {
|
|
49
|
+
return website;
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
let router = new Router();
|
|
54
|
+
Object.defineProperty(this, 'router', {
|
|
55
|
+
get() {
|
|
56
|
+
return router;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
let disk_path_client_js;
|
|
61
|
+
if (spec.disk_path_client_js) disk_path_client_js = spec.disk_path_client_js;
|
|
62
|
+
Object.defineProperty(this, 'disk_path_client_js', {
|
|
63
|
+
get() {
|
|
64
|
+
return disk_path_client_js;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
// And this could be an observable too.
|
|
69
|
+
|
|
70
|
+
// May get admin pages working on a slightly lower level.
|
|
71
|
+
// Makes sense as they are for administering other pages (mostly).
|
|
72
|
+
|
|
73
|
+
console.log('http-website-publisher disk_path_client_js', disk_path_client_js);
|
|
74
|
+
//throw 'stop';
|
|
75
|
+
|
|
76
|
+
// This could be an observable that acts sequentially and async.
|
|
77
|
+
|
|
78
|
+
const setup_website_publishing = (website) => {
|
|
79
|
+
|
|
80
|
+
return obs(async(next, complete, error) => {
|
|
81
|
+
|
|
82
|
+
for (const page in website.pages) {
|
|
83
|
+
|
|
84
|
+
const opts_bundling = {};
|
|
85
|
+
if (disk_path_client_js) opts_bundling.disk_path_client_js = disk_path_client_js;
|
|
86
|
+
|
|
87
|
+
const obs_bundling = await Webpage_Bundler.bundle_web_page(page, opts_bundling);
|
|
88
|
+
//console.log('doing bundling');
|
|
89
|
+
console.log('obs_bundling', obs_bundling);
|
|
90
|
+
|
|
91
|
+
throw 'stop';
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
const old = () => {
|
|
95
|
+
obs_bundling.on('complete', res => {
|
|
96
|
+
//console.log('obs_bundling res', res);
|
|
97
|
+
const bundle = res;
|
|
98
|
+
//console.log('bundle._arr.length', bundle._arr.length);
|
|
99
|
+
//console.log('Object.keys(bundle)', Object.keys(bundle));
|
|
100
|
+
|
|
101
|
+
if (bundle._arr.length === 1) {
|
|
102
|
+
// And check it's HTML inside...?
|
|
103
|
+
|
|
104
|
+
const bundled_item = bundle._arr[0];
|
|
105
|
+
//console.log('bundled_item', bundled_item);
|
|
106
|
+
|
|
107
|
+
if (bundled_item['content-type']) {
|
|
108
|
+
const ct = bundled_item['content-type'];
|
|
109
|
+
if (ct === 'text/html') {
|
|
110
|
+
const http_serve_html = (req, res) => {
|
|
111
|
+
res.writeHead(200, {
|
|
112
|
+
'Content-Type': 'text/html'
|
|
113
|
+
});
|
|
114
|
+
res.end(bundled_item.value, 'utf-8');
|
|
115
|
+
}
|
|
116
|
+
router.set_route(bundled_item.path, (req, res) => {
|
|
117
|
+
http_serve_html(req, res);
|
|
118
|
+
});
|
|
119
|
+
} else {
|
|
120
|
+
throw 'NYI';
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
} else {
|
|
124
|
+
throw 'NYI';
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// need to create / use the handler for it here.
|
|
128
|
+
// will have various http handler functions to reference and use.
|
|
129
|
+
// will have details of http handling in other files.
|
|
130
|
+
|
|
131
|
+
// Maybe use an HTML publisher for this? (if it's HTML).
|
|
132
|
+
// Or publisher by mime type (lookup).
|
|
133
|
+
|
|
134
|
+
// create http handler function....
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
} else {
|
|
139
|
+
|
|
140
|
+
// Multiple items at multiple paths....
|
|
141
|
+
|
|
142
|
+
each(bundle, item => {
|
|
143
|
+
//console.log('item', item);
|
|
144
|
+
//console.log('item.path', item.path, item['content-type']);
|
|
145
|
+
|
|
146
|
+
if (item['content-type']) {
|
|
147
|
+
const ct = item['content-type'];
|
|
148
|
+
if (ct === 'text/html') {
|
|
149
|
+
const http_serve_html = (req, res) => {
|
|
150
|
+
res.writeHead(200, {
|
|
151
|
+
'Content-Type': 'text/html'
|
|
152
|
+
});
|
|
153
|
+
res.end(item.value, 'utf-8');
|
|
154
|
+
}
|
|
155
|
+
router.set_route(item.path, (req, res) => {
|
|
156
|
+
http_serve_html(req, res);
|
|
157
|
+
});
|
|
158
|
+
} else {
|
|
159
|
+
const http_serve_any = (req, res) => {
|
|
160
|
+
res.writeHead(200, {
|
|
161
|
+
'Content-Type': ct
|
|
162
|
+
});
|
|
163
|
+
res.end(item.value, 'utf-8');
|
|
164
|
+
}
|
|
165
|
+
router.set_route(item.path, (req, res) => {
|
|
166
|
+
http_serve_any(req, res);
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
//throw 'NYI';
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
} else {
|
|
173
|
+
throw 'NYI';
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
})
|
|
177
|
+
|
|
178
|
+
//console.trace();
|
|
179
|
+
//throw 'NYI';
|
|
180
|
+
}
|
|
181
|
+
})
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
//console.log(`${property}: ${object[property]}`);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
});
|
|
194
|
+
// put pages into a router here...
|
|
195
|
+
// however, may need to be on the lookout for other content that needs to be bundled with each page in the site.
|
|
196
|
+
|
|
197
|
+
// Now let's try bundling an active JS client.
|
|
198
|
+
// May need to compile / render JSGUI Controls to HTML / full HTML pages.
|
|
199
|
+
|
|
200
|
+
// And unspecified pages such as admin pages?
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
//throw 'NYI';
|
|
204
|
+
}
|
|
205
|
+
if (website) {
|
|
206
|
+
setup_website_publishing(website);
|
|
207
|
+
} else {
|
|
208
|
+
this.raise('ready');
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// Create a router for the website if it does not already have one.
|
|
212
|
+
// Or maybe not....
|
|
213
|
+
|
|
214
|
+
// Do we already know all of the pages in the website?
|
|
215
|
+
// Maybe there are dynamic pages.
|
|
216
|
+
|
|
217
|
+
// Probably best to come up with a bundle here, or at an early stage.
|
|
218
|
+
|
|
219
|
+
// .prepare_bundle?
|
|
220
|
+
|
|
221
|
+
// .bundle?
|
|
222
|
+
// seems clearest that we will be getting / preparing multiple files.
|
|
223
|
+
|
|
224
|
+
// Bundling and compiling web content seems like a better thing to get working before serving (or attempting to serve) it.
|
|
225
|
+
// .build?
|
|
226
|
+
|
|
227
|
+
}
|
|
228
|
+
handle_http(req, res) {
|
|
229
|
+
|
|
230
|
+
// Called from a different context? Doubt we want that.
|
|
231
|
+
// Now called strangely, without context.
|
|
232
|
+
|
|
233
|
+
const {website, router} = this;
|
|
234
|
+
|
|
235
|
+
//console.log('HTTP_Website_Publisher handle_http');
|
|
236
|
+
//console.log('Object.keys(req)', Object.keys(req));
|
|
237
|
+
//console.log('Object.keys(req.headers)', Object.keys(req.headers));
|
|
238
|
+
|
|
239
|
+
const {url, method, statusCode, httpVersion} = req;
|
|
240
|
+
const accept_encoding = req.headers['accept-encoding'];
|
|
241
|
+
const {host} = req.headers;
|
|
242
|
+
|
|
243
|
+
//console.log('[httpVersion, host, url, statusCode, method, accept_endoding]', [httpVersion, host, url, statusCode, method, accept_encoding]);
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
//console.log('router', router);
|
|
247
|
+
//console.log('this.router', this.router);
|
|
248
|
+
//console.log('this', this);
|
|
249
|
+
//console.trace();
|
|
250
|
+
router.process(req, res);
|
|
251
|
+
|
|
252
|
+
// can then get the port from after the : in the host.
|
|
253
|
+
|
|
254
|
+
//router.set_route(url,)
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
// But then the website itself, does it have a router?
|
|
259
|
+
// It (probably) should.
|
|
260
|
+
|
|
261
|
+
// Possibly the publisher has the router for the website.
|
|
262
|
+
|
|
263
|
+
// May have bundle already prepared anyway.
|
|
264
|
+
// Possibly the Website or the Website_Resource could do the bundling / building.
|
|
265
|
+
// Could even bundle into a ZIP file :)
|
|
266
|
+
|
|
267
|
+
//throw 'NYI';
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
module.exports = HTTP_Website_Publisher;
|
package/publishing/notes.md
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
Function publishing, and some other sorts of publishing, should maybe be contained in another module / set of modules.
|
|
2
2
|
May need to work without all the HTML and Control things for some applications.
|
|
3
3
|
|
|
4
|
+
Will have more of an abundance of mid-level HTTP publishing code.
|
|
4
5
|
|
|
5
6
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Resources are a way to wrap a thing / process
|
|
2
|
+
For the moment some have handle_http functions
|
|
3
|
+
|
|
4
|
+
Resources will be more about encapsulation of functionality
|
|
5
|
+
So a resource is a mostly known quality of programmatic unit.
|
|
6
|
+
|
|
7
|
+
Resources may be wrapped / published in other things.
|
|
8
|
+
|
|
9
|
+
The Resource class / subclass itself contains and represents some other
|
|
10
|
+
piece of functionality in most cases.
|
|
11
|
+
|
|
12
|
+
More general purpose, or otherwise specific, non-Resource code
|
|
13
|
+
can then be wrapped in a Resource. In many cases the code in the Resource
|
|
14
|
+
class wraps some other code that does something specific.
|
|
15
|
+
|
|
16
|
+
|