Git Product home page Git Product logo

templateonlineexperiment's Introduction

Template for JsPsych Experiments

The setup includes:

  • experiment.js file:
    • where the experiment is coded
    • the commitToRepo() function to send the jsonData to netlify function
  • .netlify/functions/api
    • where the jsonData is received and pushed to repo

How to Setup the authentication

  1. Create Netlify account and sync with the GitHub repository to be deployed
  2. Go to Deploy Settings > Functions > Settings > Functions directory and add directory where functions will be stored i.e., .netlify/functions/api
  3. Go to GitHub settings (under your own profile) > Developer settings > Personal access tokens and generate a new token.
  4. Go to Environment under the same netlify settings to add a GH_TOKEN environment variable, which is the value of the personal access token

Customization: Edit the .netlify/functions/api.js file

  1. Commit information
  • REPO_NAME
  • REPO_OWNER
  1. Function: createOrUpdateFileContents()
  • committer.name
  • committer.email
  • author.name
  • author.email

templateonlineexperiment's People

Contributors

dominiquemakowski avatar hungpham2511 avatar penguimelia avatar tam-pham avatar zen-juen avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

templateonlineexperiment's Issues

Get IP info

I'd like to add IP / localization information. Here I've found this nice little piece of code:

fetch('https://extreme-ip-lookup.com/json/')
.then( res => res.json())
.then(response => {
    console.log("Country: ", response.country);
 })
 .catch((data, status) => {
    console.log('Request failed');
 })

That fetches a json object containing some useful information. However, I'd like to put it in a function so that it returns the whole object, or an object {status: "failure"} if it fails. But I don't know how to extract the whole response object from the .then promise πŸ˜… @penguimelia any idea?

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.