Coder Social home page Coder Social logo

serverless-api's Introduction

serverless-api

本项目提供了一个调用Github Dispatches 接口 基于Vercel + Serverless 部署
你也可以 Fork 此仓库部署到自己的 Vercel 上

参数说明

  • user: Github用户名
  • repo: Github仓库名
  • token: Github Token
  • event_type: 配置在 Github workflows 中的repository_dispatch.types的值
on:
  # 允许手动push触发
  push:
    branches:
      - main
  # 允许外部仓库事件触发
  repository_dispatch:
    types:
      - deploy // event_type就是这个

接口调用方式:

  • 浏览器直接发起Get请求
https://serverless-api-elog.vercel.app/api/github?user=xxx&repo=xxx&event_type=xxx&token=xxx
  • curl 发起Get/Post请求
curl --location --request POST 'https://serverless-api-elog.vercel.app/api/github?user=xxx&repo=xxx&event_type=xxx&token=xxx'
curl --location --request POST 'https://serverless-api-elog.vercel.app/api/github' \
--data-raw '{
    "user": "xxx",
    "repo": "xxx",
    "token": "xxx"
    "event_type": "xxx",
}'

serverless-api's People

Contributors

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