Comments (3)
Hi @algofoogle ,
I apologize if things take time - these are busy times for me.
Perhaps the definition of "assets" in the documentation is unclear, but "assets" refers only to dynamic assets that require "rendering" or "baking".
This would be SCSS files that need to be rendered as CSS files, or CoffeeScript files that need to be rendered as Javascript files.
The :assets
router will not render any jpg
files, since they don't require to be rendered.
You could, of course, Plezi:: AssetBaker.register
a "driver" for jpg
files (that driver would do nothing except load the file to memory)...
...but the correct way to serve static files would be to setup the server to serve static files from the Public folder.
If you're using the latest version of Plezi's default server (iodine, 0.7.38), the correct way to set up a public folder (for serving static files) would be to either (in code / irb
):
Iodine::DEFAULT_HTTP_ARGS[:public] = './public'
Or, from the command line, when starting iodine:
$ iodine -www ./public
You can run iodine -?
or iodine -h
to list all the command line interface options.
P.S.
Also, I should note that most of Plezi's features (except for the router, renderer and asset baking) have been transferred into the iodine gem (the default server).
Originally, Plezi "hijacked" connection to enable real-time updates and pub/sub. However, this resulted in code duplication between the server IO management system and the WebSocket management system - so both systems were unified under the "iodine" Ruby server.
Since not many people actually use Plezi, the current long term plan is to move as much as possible from Plezi to the iodine server, so Plezi remains as simple as possible and requires minimal maintenance. The iodine server will also move from development to maintenance once it matures (as it appears to have almost done).
from plezi.
Ah great, thanks @boazsegev :) Iodine::DEFAULT_HTTP_ARGS[:public] = './public'
is what I needed. I will try that soon.
I had previously submitted a pull request for getting involved with improving documentation. If you are happy with that one, I will try to submit another that includes more about assets, asset baking, and perhaps this example too.
I was interested first in Plezi because I didn't like having to set up such a huge stack as Rails 6 just to start learning how to do some things with WebSockets in Ruby. Now I will study more about iodine, too :)
Thanks!
from plezi.
Thanks for the PR and your kind help.
Have fun and good luck with everything! 👏🏻👏🏻👍🏻
from plezi.
Related Issues (20)
- ERROR -- : uninitialized constant OpenSSL::SSL::SSLErrorWaitReadable (NameError) HOT 10
- ERROR -- : incompatible character encodings: ASCII-8BIT and UTF-8 (Encoding::CompatibilityError) HOT 11
- Documentation help needed. HOT 2
- WebSocket connection to 'ws://localhost:3000/ws' failed: Error during WebSocket handshake: Unexpected response code: 200 HOT 21
- JSON event length is limited HOT 10
- Server configs HOT 4
- download error with bundled client.js HOT 1
- rabbitmq HOT 1
- Finding a websocket session and send message HOT 8
- SyntaxError in generated config.ru
- Rack < 2.0 : cannot load such file -- rack/query_parser.rb HOT 1
- message_size_limit uninitialized constant Iodine::Http HOT 10
- create function is not synchronized HOT 19
- server shutdown when one or more client has a poor connection HOT 7
- Upgrade to bundler 2.0 HOT 3
- Help needed! HOT 1
- Failing at higher concurrency HOT 2
- Architectural clarification HOT 2
- There is no way to unsubscribe from Plezi::Controller.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plezi.