UNPKG

@gameroom/gameroom-kit

Version:

Node kit for the Gameroom API

13 lines (7 loc) 455 B
const APIAdapter = require('@emporium/api-adapter'), { encode } = require('base-64'); const domain = process.env.GAMEROOM_API_URL || process.env.NODE_ENV === 'production' ? 'https://api.gameroomforpresident.com' : 'http://localhost:3000'; const headers = { 'Content-Type': 'application/json; charset=utf-8' }; const adapter = new APIAdapter({ domain, headers }); adapter.encodingMethod = (p) => encode(JSON.stringify(p)); module.exports = adapter;