Skip to content

Instantly share code, notes, and snippets.

@sans-clue
sans-clue / index.js
Last active March 20, 2024 16:50
Serverless Framework - VPC - Static IP
/* global fetch */
const serverless = require("serverless-http");
const express = require("express");
const app = express();
app.use(async (req, res, next) => {
const response = await fetch("https://api.ipify.org");
const ip = await response.text();
res.locals.ip_addr = ip;
next();