GithubHelp home page GithubHelp logo

fbinstant-tictactoe-server's Introduction

Instant Games Server Demo

This demo contains code that demonstrates common scenarios in a backend service that supports an Instant Game client: a game bot and a storage service.

Pre-requisites

  1. npm (Install npm)
  2. Postgresql(Install Postgresql)

Install Dependencies

$ npm install

Configure environment variables

You can rename the file template.env into just .env and input test values of the variables below. This file will be used for local testing. When you host your code in the cloud, you'll need to reconfigure these variables to their production values.

  1. BOT_VERIFY_TOKEN: create a memorable word. You'll use that to validate webhooks with your Messenger Bot
  2. APP_SECRET: paste your App Secret. This can be found in your App's settings page.
  3. USE_SECURE_COMMUNICATION: 1
  4. PAGE_ACCESS_TOKEN: leave blank for now.
  5. DATABASE_URL: connection string to your Postgres installation

Create a Facebook page that will host your bot

  1. Follow the instructions on the Game Bot setup guide to setup a Facebook page that will host your game bot
  2. When associating the Webhooks, under the Verify Token field, input the memorable word you created for BOT_VERIFY_TOKEN above
  3. Once webhooks are configured, copy your Page's access token into the PAGE_ACCESS_TOKEN environment variable of your hosted app.

All done! Your Backend service is configured! You can run your code with

$ node index

Running the client-side code

Follow the instructions in the README.md of the client-side counterpart of this demo:

https://github.com/edgarjcfn/fbinstant-communication

fbinstant-tictactoe-server's People

Contributors

jsdelivrbot avatar osterreich avatar

Watchers

 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.