21 lines
527 B
JavaScript
21 lines
527 B
JavaScript
const express = require("express")
|
|
const app = express()
|
|
const PORT = 3000
|
|
|
|
app.get("/", function(req, res) {
|
|
let count = req.query.count
|
|
let bg = req.query.bg
|
|
|
|
let html = '<html><head><title>B</title></head><body style="display: flex; flex-wrap: wrap;">'
|
|
for(let i = 0; i < count; i++) {
|
|
html += `<div style="width: 100px; height: 100px; margin: 0.25em; background-color: ${bg};"></div>`
|
|
}
|
|
html += '</body></html>'
|
|
|
|
res.send(html)
|
|
})
|
|
|
|
app.listen(PORT, function() {
|
|
console.log(PORT)
|
|
})
|