Skip to content

Instantly share code, notes, and snippets.

function server(req, res) {
return res.end(App({ url: req.url }));
}
function App({ url }) {
return `
<!doctype html>
<html class="app">
<head>
<meta charset="utf-8" />
function server(req, res) {
const { url } = req;
if (url === '/') {
res.end('Main');
} else if (url === '/about') {
res.end('About');
} else {
res.end('404');
}
const http = require('http');
const PORT = 4000;
http.createServer(server).listen(PORT);
function server(req, res) {
res.end('Hello, dude');
}
mkdir slender
cd slender
touch server.js