Package Protocol: Difference between revisions
No edit summary |
(package2) |
||
| Line 8: | Line 8: | ||
*'''NOTE''': JSON Require only works in '''CEF'''. | *'''NOTE''': JSON Require only works in '''CEF'''. | ||
==Package2== | |||
<pre>http://package2/</pre> Similar to package/ but is cached in memory on connection and provides instant access, also packs all CEF resources into a single file (example: if you have loads of files in your cef (images etc) it packs them into a single 30MB file) | |||
Only works if your cef files are stored in '''client_packages/package2''' | |||
Revision as of 04:15, 29 May 2024
Summary
http://package/ is the protocol for the root folder of client_packages, so http://package/ returns client_packages, makes it easier for you to require files client-side.
When referencing to other files in client_packages, you use
http://package/
For example, a file located in client_packages\index.html can be referred to with
http://package/index.html
A file located in client_packages\my-resource\index.html can be referred to with
http://package/my-resource/index.html
You can also require json files with it http://package/my-resource/beasts.json, so it'll be
const beasts = require('http://package/my-resource/beasts.json')
- NOTE: JSON Require only works in CEF.
Package2
http://package2/
Similar to package/ but is cached in memory on connection and provides instant access, also packs all CEF resources into a single file (example: if you have loads of files in your cef (images etc) it packs them into a single 30MB file)
Only works if your cef files are stored in client_packages/package2