项目作者: jsdev63

项目描述 :
React form builder
高级语言: JavaScript
项目地址: git://github.com/jsdev63/react-form-builder.git
创建时间: 2018-06-29T20:10:50Z
项目社区:https://github.com/jsdev63/react-form-builder

开源协议:

下载


React Formbuilder

Installation

To run the formbuilder locally, you can issue the following commands:

  1. `bash
  2. $ cd React_FormBuilder
  3. $ npm install
  4. $ npm run start

When you generate a form, you’re actually generating two tokens:

  • the adminToken, that you need to keep secret, giving you access to all the
    submitted data;
  • the userToken, that’s used by users to find back the proper form.

One interesting property of the userToken is that it is actually half of the
admin token !

With that in mind, let’s say we’ve generated a form with an adminToken of 152e3b0af1e14cb186894980ecac95de. The userToken is then 152e3b0af1e14cb1.

So if we want to have access to the data on the server, using curl, we need to authenticate as the admin (using BasicAuth with form:{adminToken}):

  1. $ SERVER_URL="http://localhost:8888/v1"
  2. $ ADMIN_TOKEN="152e3b0af1e14cb186894980ecac95de"
  3. $ FORM_ID="152e3b0af1e14cb1"
  4. $ curl $SERVER_URL/buckets/formbuilder/collections/$FORM_ID/records \
  5. -u form:$ADMIN_TOKEN | python -m json.tool
  6. {
  7. "data": [
  8. {
  9. "how_are_you_feeling_today": "I don't know",
  10. "id": "7785a0bb-cf75-4da4-a757-faefb30e47ae",
  11. "last_modified": 1464788211487,
  12. "name": "Clark Kent"
  13. },
  14. {
  15. "how_are_you_feeling_today": "Quite bad",
  16. "id": "23b00a31-6acc-4ad2-894c-e208fb9d38bc",
  17. "last_modified": 1464788201181,
  18. "name": "Garfield"
  19. },
  20. {
  21. "how_are_you_feeling_today": "Happy",
  22. "id": "aedfb695-b22c-433d-a104-60a0cee8cb55",
  23. "last_modified": 1464788192427,
  24. "name": "Lucky Luke"
  25. }
  26. ]
  27. }