Package Protocol: Difference between revisions
No edit summary |
No edit summary |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{JSContainer| | |||
* | ==Summary== | ||
<code>http://package/</code> is the protocol for the root folder of `client_packages`, allowing easy access to files client-side. | |||
When referencing files in `client_packages`, use <pre>http://package/</pre>. Examples: | |||
* A file in `client_packages\index.html` can be accessed as <pre>http://package/index.html</pre>. | |||
* A JSON file in `client_packages\my-resource\beasts.json` can be required as <pre>const beasts = require('http://package/my-resource/beasts.json');</pre>. | |||
==Package2== | |||
<pre>http://package2/</pre> functions similarly, caching resources for faster access. Works if CEF files are in `client_packages/package2`. | |||
}} | |||
Latest revision as of 16:53, 8 November 2024
JavaScript Syntax
Summary
http://package/ is the protocol for the root folder of `client_packages`, allowing easy access to files client-side.
http://package/. Examples:
- A file in `client_packages\index.html` can be accessed as
http://package/index.html
. - A JSON file in `client_packages\my-resource\beasts.json` can be required as
const beasts = require('http://package/my-resource/beasts.json');.
Package2
http://package2/functions similarly, caching resources for faster access. Works if CEF files are in `client_packages/package2`.