udara
v1.2.2
Published
Bind html and nodejs code inside a single file.
Downloads
5
Maintainers
Readme
UDARA
Bind html and nodejs code inside a single file.
Main js file
Main file will be executed by "node index.js" command
/* Filename : /index.js */
const [port, message] = [4120, 'Udara started!']
require('udara').start(port, message)
Run udara
$node index.js
Udara syntaxs
Including
-=( filename, { someData } )=-
Scripting
-=[ /* Some code */ ]=-
Printing
-={ /* Some data */ }=-
Example
Use .udara extention for this file.
<!-- Filename : /index.udara -->
-=( 'nav', { someData } )=- <!-- Including -->
<h1>Main page</h1>
-=[ <!-- Scripting -->
const y = 10
for ( let x = 0; x < y; x++ ) {
print('x = ' + x) <!-- Printing inside script -->
}
]=-
<b>-={ y }=-</b> <!-- Printing outside script -->
That's all you need to do. Let's go to http://localhost:4120/index.udara
Settings file
Create settings.json file to costumize where the file should be uploaded
{
"uploadDir":"./upload/"
"ignoreFavicon":true
}
Update version 1.2.1
- handle form for file upload
- add user settings