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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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('test@example.com', 'password').then(function() { | |
| // Create a new project instance. | |
| var project = new project('https://myapp.form.io'); | |
| // Bind to a form. |
This file contains hidden or 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
| module.exports = function(req, next) { | |
| // Append .example.com to emails for testing purposes... | |
| req.body.data.email += '.example.com'; | |
| next(null); | |
| }; |
This file contains hidden or 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
| for (var i = 0; i < 9999999999; i++) { | |
| var num = ("0000000000" + i).substr(-10,10); | |
| var counts = [0,0,0,0,0,0,0,0,0,0]; | |
| for (var j = 0; j < 10; j++) { | |
| counts[num[j]]++; | |
| } | |
| if (counts.join('') === num) { | |
| console.log('Winner!' + num); | |
| break; | |
| } |
npm install -g formio/formio-cli#master
formio bind POST https://myapp.form.io/myform ./middleware.js
This file contains hidden or 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
| [ | |
| { | |
| "timezone": "Afghanistan Standard Time", | |
| "display": "(GMT+04:30) Kabul" | |
| }, | |
| { | |
| "timezone": "Alaskan Standard Time", | |
| "display": "(GMT-09:00) Alaska" | |
| }, | |
| { |