Created
March 29, 2023 07:40
-
-
Save dsathyakumar/d592e08c36b80606e741e936a5368026 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('marko/node-require').install(); | |
const http = require('http'); | |
const server = require('http').createServer(); | |
const port = 8080; | |
const indexTemplate = require('./index.marko'); | |
server.on('request', (req, res) => { | |
indexTemplate.render({ | |
name: 'Frank', | |
count: 30, | |
colors: ['red', 'green', 'blue'] | |
}, res); | |
}); | |
server.listen(port, () => { | |
console.log(`Successfully started server on port ${port}`); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment