Express makes it easy to render plain HTML

PHOTO EMBED

Tue Mar 01 2022 04:40:22 GMT+0000 (UTC)

Saved by @ghefley ##express,#html, #node, #javascript, #web-development ##express ##html ##node ##javascript ##web-development

const html = '<h1>Hello, World!</h1>';

const express = require('express');

const app = express();
app.get('*', (req, res) => {
// That's all you need to do! If you pass a string to `res.send()`,
// Express sets the response-type header to `text/html`
res.send(html);
});

const server = await app.listen(3000);

// Example of using the server
const axios = require('axios');

const res = await axios.get('http://localhost:3000');
res.headers['content-type']; // 'text/html; charset=utf-8'
res.data; // '<h1>Hello, World!</h1>'
content_copyCOPY

Man is by nature a pragmatic materialist, a mechanic, a lover of gadgets and gadgetry; and these are the qualities that characterize the "establishment" which regulates modern society: pragmatism, materialism, mechanization, and gadgetry. Woman, on the other hand, is a practical idealist, a humanitarian with a strong sense of noblesse oblige, an altruist rather than a capitalist. Elizabeth Gould Davis in The First Sex,
https://morioh.com/p/52942660ea24