Git Product home page Git Product logo

vercel-deno-runtime's Introduction

Deno Runtime for Vercel (vercel-deno-runtime)

A runtime designed for those who wants to migrate serverless functions built on Node runtime to 🦕Deno that is compatible with ▲Vercel's NowRequest and NowResponse.

Usage

// vercel.json
{
  "functions": {
    "api/**/*.{ts,tsx}": {
      "runtime": "vercel-deno-runtime"
    }
  },
  "build":{
    "env":{
      "DENO_VERSION":"1.1.0 OR latest",
      "DENO_CONFIG":"tsconfig.json",
      "DENO_UNSTABLE":true
    }
  }
}
// /api/hello.ts
import { NowRequest, NowResponse } from "https://unpkg.com/vercel-deno-runtime@latest/dist/boot/nowHandler.ts";
  
export default async function handler(req:NowRequest,res:NowResponse) {
  res.statuscode(200).send(`Welcome to deno ${Deno.version.deno} 🦕`);
}

Note: vercel v17.x or above are required to use the above configuration.

Configurations

Name Description Default
DENO_VERSION Which deno version to be used for serverless functions latest
DENO_CONFIG Implement custom tsconfig.json to be used for serverless functions <empty>
DENO_UNSTABLE add --unstable flag at build-time deno cache and runtime deno run false

Development

  • Suport Now Launcher
  • add support for windows
  • implement caching for downloading deno
  • add support for macos

References

vercel-deno-runtime's People

Contributors

nexxkinn avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  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.