Skip to content

A sample node.js app that accepts data from the GameSalad "Network Send Table to URL" Behavior and converts it into a Tin Can API Statement.

License

Notifications You must be signed in to change notification settings

gamesalad/gstables-to-tincanapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gstables_to_tincanapi

A sample node.js app that accepts data from the GameSalad "Network Send Table to URL" Behavior and converts it into a Tin Can API Statement.

The conversion is based on the table headers. Each header acts like a JSON object path. Each path segment is separated by an '_'.

Let's say we have a GameSalad table with a column that has the label "actor_name". Each row of the table represents one statement object. The first row has the value "Sally" for the column "actor_name".

The first row would translate into the following Tin Can Statement Object:

{
	"actor": {
		"name": "Sally"
	}
}

This app will parse the incoming json data, convert it to a statement, add an ID and timestamp to the statement, and then log the statement to the console.

To test:

Start the server app:

git clone [email protected]:gamesalad/gstables_to_tincanapi.git
cd gstables_to_tincanapi
npm install
node inde.js

Load up GameSalad Creator and load the TinCanApiExample app. Hit "Preview" and you will see a big white button. Click on the button to send data to the app.

The app assumes port 3000 is free and the example GameSalad project assumes the app can be accessed via http://localhost:3000.

About

A sample node.js app that accepts data from the GameSalad "Network Send Table to URL" Behavior and converts it into a Tin Can API Statement.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published