Code Monkey home page Code Monkey logo

realworld-apps-script's Introduction

RealWorld Google Apps Script Example App using gs RealWorld example app (WIP)

Description

Getting Started

  • npm install install dependencies

  • copy src\server\config.template.js to src\server\config.js

    • change the jwt encryption key and also give the id to the google script you're going to link it to
  • npx clasp login Log in to Google clasp and authorize with your Google account. Open the link and authorize.

  • Setup database and deploy location (options)

    1. npx clasp create --type sheets --title "RealWorld Apps Script Project" --rootDir ./dist Create a new Google Script bound to a Google Sheet (or set the type as standalone to create a standalone script in your Google Drive). Follow prompts in cmd to setup. May need to run this 2x and delete first document created after following the prompts.
    • Linked scripts file will be located in .clasp.json
    1. Copy template
    • Tools > Script Editor > copy the script id into from the url .claps.json

Deploy

  • npm run deploy
  • npm run deploy:prod Deploy the project (production mode)
  • faster development
    • npm run watch can auto build webpack files for dev mode for faster development cycle
    • npm run upload manually upload dist files

Proxy

  • see ref

    • proxy allows cors issues to be resolved while in browser
    • also DELETE and PUT requests will be forced to POST requests
    • besides content-type in POST request doesn't support headers, proxy will accept Authorization: Token {{token}} and will forward in post body
  • run simple server

    • cd proxy
    • php -S localhost:8000
    • open http://localhost:8000/

Development vs Production mode

In the production mode, the function names and variable names are shrinked and the output code is auto-minifed. The production mode is not recommended for testing and debugging the Apps Script code.

The .claspignore file

The .claspignore file allows you to specify file and directories that you do not wish to not upload to your Google Apps Script project via clasp push.

The default .claspignore file of the Apps Script Starter kit will push all the JS and HTML inside the rootDir folder and ignore all the other files.

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.