Skip to content

Instantly share code, notes, and snippets.

View theinfosecguy's full-sized avatar
👨‍💻
Hack, Build & Break

Keshav Malik theinfosecguy

👨‍💻
Hack, Build & Break
View GitHub Profile
@theinfosecguy
theinfosecguy / index.js
Created February 22, 2023 12:39
Entry Point for Sample NodeJS App for Deployment
const express = require('express');
const bodyParser = require('body-parser');
const helmet = require('helmet');
const compression = require('compression');
const app = express();
app.use(bodyParser.urlencoded({extended: true}));
app.use(express.static('public'));
@theinfosecguy
theinfosecguy / main.py
Created June 30, 2022 18:10
Python FastAPI Basic API Setup
from fastapi import FastAPI
app = FastAPI()
todo_items = []
@app.get("/health")
def health():
return {"status": "ok"}
@theinfosecguy
theinfosecguy / _document.js
Last active October 18, 2021 14:23
_document.js for NextJS and Google Analytics
import Document, { Html, Head, Main, NextScript } from 'next/document'
class MyDocument extends Document {
static async getInitialProps(ctx) {
const initialProps = await Document.getInitialProps(ctx)
return { ...initialProps }
}
render() {
return (