full-js-engen
v1.0.5
Published
<h1>full-js-engen</h1> <h3>install</h3> <pre> <code> npm i full-js-engen
Downloads
4
Readme
/* then use app.use(require('full-js-engen')) */
function SetHTMLHeader(){
const appTitle = "hello world"
const stylesDark = body{
font-family:arial;
background-color:#111;
color:#fff
}
bld.head(()=>{
bld.title(()=>{
bld.var(appTitle)
})
bld.css(()=>{build.var(stylesDark)})
})
}
app.get("/",(req,res)=>{ res.buildHTML(()=>{ bld.DOCTYPEhtml() bld.html(()=>{ SetHTMLHeader() bld.body(()=>{ bld.form(()=>{ bld.input(type="text",name="x",required=true) bld.input(type="submit",value="send") },action="/") }) }) });res.sendHTML() })
app.get("/2",(req,res)=>{ array = ["jhon","zack","rick","bubbles","corry"] res.buildHTML(()=>{ bld.DOCTYPEhtml() bld.html(()=>{ SetHTMLHeader() bld.body(()=>{ bld.h1(()=>{build.var("name list")}) for(z=0;z<array.length;z++){ bld.p(()=>{ bld.var(array[z]) }) } bld.button(()=>{ bld.var("button text") },onclick = "test()") bld.script(()=>{ console.log("the script worked") function test(){ alert("hello") } }) }) }) });res.sendHTML() })
app.get("/3",(req,res)=>{ res.buildHTML(()=>{ bld.DOCTYPEhtml() bld.html(()=>{ SetHTMLHeader() bld.body(()=>{ bld.button(()=>{ bld.var("button text") },onclick = "test()") bld.script(()=>{ console.log("the script worked") function test(){ alert("hello") } }) }) }) });res.sendHTML() })
app.get("/4",(req,res)=>{ res.buildHTML(()=>{ var buildpage = require("./path to js file.js") buildpage() }) res.sendHTML() })
app.listen(8080)