0.1.0 • Published 2 years ago
lightwebtool v0.1.0
LWT - Light Web Tool
LWT is "templating system" based on first idea of PHP creator Rasmus Lerdorf. In LWT you write your application login in controller file which is .js writen in nodejs. Then showing it in .lwt file.
Example:
index.lwt
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Simple LWT Application</title>
</head>
<body>
<?lwt write getName() /?>
</body>
</html>
controller.js
module.exports = {
getName() {
return "Hello!"
}
}
server.js
const lwt = require("lightwebtool")
const express = require("express")
const app = express()
app.get('/', (req, res) => {
res.send(lwt("index.lwt", require("./controller.js")))
})
app.listen(3000, () => console.log("LWT Application works!"))
Documentation
To execute some functions from controller use this:
<?lwt write functionName() ?>
Other functions There is no any other functions, only write.
0.1.0
2 years ago