This is a complete installation script of a standalone Form.io server within Ubuntu Server. You must upgrade one of your Form.io projects to Enterprise to get this working.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var formio = require('formio-service')(); | |
var Project = formio.Project; | |
// First authenticate. | |
formio.authenticate('[email protected]', 'password').then(function() { | |
// Create a new project instance. | |
var project = new project('https://myapp.form.io'); | |
// Bind to a form. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Bind to the submission of the form. | |
$rootScope.$on('formSubmission', function (event, submission) { | |
if (!submission) { | |
return; | |
} | |
// See if this is a new user or existing. | |
$http.get(AppConfig.appUrl + '/user/exists', { | |
params: { | |
'data.email': submission.data.email |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.controller('renderComplete', [ | |
'$scope', | |
'FormioUtils', | |
function( | |
$scope, | |
FormioUtils | |
) { | |
var renderComplete = function() { | |
$scope.$emit('formRenderComplete'); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require("request"); | |
// The api key is generated within the Form.io project settings. | |
var apiKey = '23kj2k3jhkj2h3'; | |
// Create a new user. | |
request({ | |
method: 'POST', | |
url: 'https://example.form.io/user/submission', | |
headers: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div ng-controller="StipePayment"> | |
<formio form="form" submission="submission"></formio> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;"> | |
<head> | |
<meta name="viewport" content="width=device-width" /> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<title>Actionable emails e.g. reset password</title> | |
<style type="text/css"> | |
img { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FormioResourceProvider.register('todo', AppConfig.forms.todoForm, { | |
defaultValue: {data: {status: 'notstarted'}}, | |
templates: { | |
view: 'views/todo/view.html' | |
}, | |
controllers: { | |
create: ['$scope', '$rootScope', function($scope, $rootScope) { | |
$rootScope.whenReady.then(function() { | |
$scope.submission = {data: { | |
email: $rootScope.user.data.email |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require("request"); | |
var options = { | |
method: 'POST', | |
url: 'https://myproject.form.io/report', | |
headers: { | |
'content-type': 'application/json', | |
'x-jwt-token': '..... TOKEN GOES HERE .....' | |
}, | |
body: [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var submission = { | |
data: { | |
firstName: 'Test', | |
lastName: 'Person', | |
email: '[email protected]', | |
phoneNumber: '123123123123' | |
} | |
}; | |
var settings = { | |
"async": true, |