Skip to content

Instantly share code, notes, and snippets.

View CodisRedding's full-sized avatar
🎯
Focusing

Rocky Assad CodisRedding

🎯
Focusing
View GitHub Profile
@CodisRedding
CodisRedding / formio-auth.js
Last active August 8, 2016 20:20 — forked from rahatarmanahmed/formio-auth.js
Authentication Example.
var request = require('request');
request.post(
'https://formio.form.io/user/login',
{
data: {
'email': email,
'password': password
}
},
import superagent from 'superagent';
import config from '../config';
import cookie from 'react-cookie';
const methods = ['get', 'post', 'put', 'patch', 'del'];
function formatUrl(path) {
const adjustedPath = path[0] !== '/' ? '/' + path : path;
if (__SERVER__) {
// Prepend host and port of the API server to the path.
@CodisRedding
CodisRedding / http.agent.nut
Last active August 29, 2015 14:27 — forked from ElectricImpSampleCode/http.agent.nut
This example shows a minimal HTTP Request handler function with the recommended structure.
// Define an HTTP request handler
function requestHandler(request, response) {
try {
if ("setting" in request.query) {
// 'setting' is a URL-encoded parameter, ie. '/setting=4'
local settingValue = request.query.setting;
// Use the 'response' object to acknowledge reception of the request
// to the request's source. '200' is HTTP status code for 'OK'
response.send(200, "Setting received and applied");