@wal-li/page
v1.1.3
Published
## Getting Started
Readme
@wal-li/page
Getting Started
npm i -g @wal-li/pagewlp serve <project-dir>wlp bundle <project-dir> <output-file>Concept
Serve
flowchart LR
S[Server]-->E[Execute]
E-->N[Navigate]
N-->R[Render]
R-->P[Response]Bundle
flowchart LR
B[Bundle]-->F[File]Render
- Render WLP script and view and return an object contains script and view results.
exports.handlerwill run first and the result is placed intoresult. This variable can access in the view content.- The view content can access:
contextresultexportsdumprequest
Navigate
- Handle routes in givens WLP and return a HTTP response object.
- Default route is
/. - If
layoutis used, the final result is the layout result.
Not Found cases:
- No matched route.
- Is template but no template found.
- Has layout but no layout found.
- No
scriptresult and noviewresult.
Response:
status:script.statusor200(if has body) or404(without body).body:vieworscript.bodyor empty (if has status) orNot Found(no status).headers:script.headersor auto headers based on body.
Execute
Parse and execute WLP content and return a HTTP response object.
Author
HaoVA [email protected] (https://www.haova.me)
License
MIT.
