Giter Club home page Giter Club logo

serverless-trash's Introduction

Serverless trash

Let's be real, devs. We all have thousands of projects we'll never finish, and ever more we'll never start.

That's why i created this repo. I know perfectly that I won't never do whatever I wanna do if it takes more than 30s to do it ; that infra should not cost anything, and that all the pipelines should already be ready.

This repo is a simple barebone vercel app which aim is to deploy only lambda functions easily. It's pre-configured, and only need a few env vars here and there to make it somehow safe.

Features

  1. Typescript native, thanks to vercel

  2. Auto deploy thanks to vercel and github actions

  3. Preview deployments on pull requests, if I ever needed to PR myself

  4. A bunch of pre-configured api clients and other neat tools on /lib (I couldn't use /api since Vercel reserves the /api for their lambdas)

  5. .env support (it's normally at nextjs' level, Vercel only allows to pull the file from cli)

  6. eslint as testing, because I don't need more than Typescript already provides

  7. Fairly straightforward generators with plop

Setup

There's pretty much no setup. Simply clone and run in Vercel should do. Depending on what you aim to use, maybe some environment variables will be expected.

Recommendations

Protect all your endpoints against spamming:

import type { VercelRequest, VercelResponse } from '@vercel/node'

import { config } from 'dotenv'
import { withSecret } from '../lib'

config()

export default withSecret((req: VercelRequest, res: VercelResponse) => {
  res.status(200).end('OK')
})
`

serverless-trash's People

Contributors

y-nk avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.