Skip to content

Instantly share code, notes, and snippets.

@destroyer22719
Created January 28, 2021 21:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save destroyer22719/4abfe279d572c00703924f89911c4ce5 to your computer and use it in GitHub Desktop.
Save destroyer22719/4abfe279d572c00703924f89911c4ce5 to your computer and use it in GitHub Desktop.
const express = require('express');
const app = express();
const serverless = require('serverless-http');
require('dotenv').config();
app.get('/', (req, res) => {
res.send('hello world');
})
app.get('/secret', (req, res) => {
res.send(process.env.API_KEY)
})
module.exports.handler = serverless(app)
app.listen(process.env.PORT || 3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment