Thanks to visit codestin.com
Credit goes to github.com

Skip to content

nicholasadamou/serverless-github-api-starter-kit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Serverless GitHub API Starter Kit

This is a starter project for accessing the GitHub API using GraphQL through a serverless WebTasks instance.

Setting up WebTasks

In order to make the asynchronous calls to the Github API, we must set up a serverless end-point that we can use to fetch information against GitHub's API (e.g. functions/index.js).

To install the dependencies necessary to use WebTask's cli, run the following:

yarn wt:install

This function will install axios and the wt-cli which we need in order to make calls to GitHub's end-point.

To create the function within WebTask, run the following:

yarn wt:create

⚠️ Please Note: If you don't run yarn wt:create, this module will not exist within the WebTasks Dashboard. You must run yarn wt:create prior to adding secrets to a given WebTask.

Now, we need to add our GitHub Personal Access Token to the index web-task. To do this, run the following:

yarn wt:edit

This will open the WebTasks Dashboard. Click on the index module in the explorer, then click on the wrench in the upper-left-hand-corner of the editor and select secrets. Click Add Secret and enter the following information being sure to type the key value correctly:

Key: GITHUB_API_TOKEN
Value: <Your-Github-Personal-Access-Token>

To learn more about adding secrets to a WebTask module, read here.

To start the WebTask's development server execute the following:

yarn wt:serve

If you have made changes to functions/index.js, you must update the deployed WebTask function using:

yarn wt:update

To learn more about WebTasks and how to use it, please visit the WebTask Documentation.

License

'serverless-github-api' is © Nicholas Adamou.

It is free software, and may be redistributed under the terms specified in the LICENSE file.

About

A starter project for accessing the GitHub API using GraphQL through a serverless WebTasks instance.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published