Skip to content

Instantly share code, notes, and snippets.

View tausiq2003's full-sized avatar
🎯
Focusing

Tausiq Samantaray tausiq2003

🎯
Focusing
View GitHub Profile
@tausiq2003
tausiq2003 / onlytemplate.js
Last active January 14, 2024 19:05
This is only.js template, it creates dynamic pages without HTML and CSS files.
const express = require("express");
const { JSDOM } = require("jsdom");
const app = express();
const port = 6969;
app.use(express.static("assets"));
app.get("/", (req, res) => {
const dom = new JSDOM(`<!DOCTYPE html>`);
const doc = dom.window.document;
// Use doc instead of document
@tausiq2003
tausiq2003 / only.js
Created January 14, 2024 18:48
This code generates a static site without HTML and CSS files, guess what it requires Express and jsdom and guess what is this website scroll till end. Thanks.
const express = require("express");
const { JSDOM } = require("jsdom");
const app = express();
const port = 6969;
app.use(express.static("assets"));
app.get("/", (req, res) => {
const dom = new JSDOM(`<!DOCTYPE html>`);
const doc = dom.window.document;
const body = doc.querySelector("body");