gas-rest

Translator of REST requests to build RESTful API using Google Apps Script

3 years after

gas-rest

Translator of REST requests to build RESTful API using Google Apps Script

Why

To build RESTful backend for frontend development for 5 minutes

Overview

Route Verb Description
/api/:script_id Get Get all items from getSheets()[0]
/api/:script_id Post Create item on getSheets()[0]
/api/:script_id/:sheet_name Get Get all items from getSheetByName(:sheet_name)
/api/:script_id/:sheet_name Post Create item on getSheetByName(:sheet_name)
/api/:script_id/:sheet_name/:item_id Get Get single item from getSheetByName(:sheet_name)
/api/:script_id/:sheet_name/:item_id Post/Put Update item on getSheetByName(:sheet_name)
/api/:script_id/:sheet_name/:item_id Delete Delete item on getSheetByName(:sheet_name)

Profit

For example we have collection of cats:

ScreenShot

And we have a script like this one, which has been deployed as a web app with ID AKfycbwEw9l-DeT3Qfv5CmRm60k0RALu2iVIyvyAuaWZbHp2we7xi1E

Now we can:

  • get all cats:

ScreenShot

  • create new cat:

ScreenShot

ScreenShot

  • update a cat:

ScreenShot

ScreenShot

  • get cat by id:

ScreenShot

  • delete a cat:

ScreenShot

ScreenShot

How to

ScreenShot

ScreenShot

  • open script editor

ScreenShot

  • paste your tables ID

ScreenShot

  • run function doGet once to authorize script

ScreenShot

ScreenShot

ScreenShot

  • disregard the error message

ScreenShot

  • save new version of script

ScreenShot

ScreenShot

  • deploy script as web app

ScreenShot

ScreenShot

ScreenShot

Now you can build app which is consuming data via RESTful API

Related Repositories

go-web-framework-benchmark

go-web-framework-benchmark

:zap: Go web framework benchmark ...

goautosocket

goautosocket

[Go] GoAutoSocket - auto-reconnecting TCP sockets in a tiny, fully tested, threa ...

awesome-go

awesome-go

A curated list of awesome Go frameworks, libraries and software. ...


Top Contributors

dab00