<h1 align="center">fmdapi-node-weaver </h1><br><br> <p align="center"> <!-- <a href="https://www.npmjs.com/package/@mindfiredigital/fmdapi-node-weaver"><img src="https://img.shields.io/npm/v/@mindfiredigital/fmdapi-node-weaver.svg?sanitize=true" alt="Vers
npm install @mindfiredigital/fmdapi-node-weaverSimplify the integration of FileMaker databases with any frontend
The @mindfiredigital/fmdapi-node-weaver is a tool that allows developers to integrate multi page document editors built on top of Canvas using React.
!FM_DataApi_Bundler_Image
NOTE: : The endpoints shown in figure are for demo purpose, these are not actual endpoints. For actual Data API endpoint, refer documentation
- Features
- Installation
- Getting Started
- Contributing
- License
- No Mandatory Session Token: Unlike the standard FileMaker Data API, the Bundler does not require a validated session token for every API call. It handles authentication using Basic Auth, generating a new session token if one is not provided or if the session has expired.
- Uniform API Endpoints: Each API endpoint in the Bundler follows a consistent style, simplifying usage and reducing confusion. Regardless of the specific API functionality, you'll find a consistent method structure.
- Automatic Session Management: Users don't need to worry about re-validating their session each time they interact with the API. The Bundler automatically manages sessions by using Basic Auth as an authentication header.
To install the @mindfiredigital/fmdapi-node-weaver npm package in your project, use the following command:
``bash`
npm install @mindfiredigital/fmdapi-node-weaver
- Initialization: Initialize the fmdapi-node-weaver in your project, specifying the function.
`javascript
const fm = require("fmdapi-node-weaver");
const PORT = 9000;
fm.run(PORT);
//If PORT is not specified, it will run on default port 8000
`
To download the project @mindfiredigital/fmdapi-node-weaver into your system, use the following command:
`bash`
git clone https://github.com/mindfiredigital/fmdapi-node-weaver
- Initialization: Install the dependencies from the package.json:
`bash`
npm i
or
`bash`
yarn
- Launch the server
`bash`
node app.js
To containerize your application using Docker, follow these steps:
- Build Docker Image: Build the Docker image using the provided Dockerfile:
`bash`
docker build -t fmdapi-node-weaver .
- Run Docker Container: Run the Docker container, mapping the desired port (e.g., 3000) to the container's port:
`bash`
docker run -p 3000:3000 fmdapi-node-weaver
- eg. http://localhost:8000/api/daApi
`
{
"fmServer":"
"method":"
"methodBody":{
"session":{
"token":"
"required":
}
}
`
- ### Signin
`
{
"fmServer":"
"method":"signin",
"methodBody":{
"username":"
"password":"
"database":"
},
"session":{
"token":"
"required":
}
}
`
- ### Signout
``
{
"fmServer":"
"method":"signout",
"methodBody":{
"database":"
},
"session":{
"token":"
"required":"
}
}
- ### CreateRecord
`
{
"fmServer":"
"method":"createRecord",
"methodBody":{
"database":"
"layout":"
"record":{
"Name": "Varun Sharma",
"Phone": "11111111111",
"Address":"Newyork"
}
},
"session":{
"token":"
"required":
}
}
`
- ### GetAllRecords
`
{
"fmServer": "
"method": "getAllRecords",
"methodBody": {
"database": "
"layout": "
"offset":"1",
"limit": 10
},
"session": {
"token": "
"required":
}
}
`
- ### FindRecord
``
{
"fmServer":"
"method":"findRecord",
"methodBody":{
"database":"
"layout":"
"offset": 0,
"limit": 0,
"layout.response": "string",
"dataformats":0,
"query":[
{"Name": "=Basudev", "Password": "=1234"},
{"Phone" : "11111111111", "omit" : "false"}
],
"sort":[
{"fieldName": "CreationTimestamp","sortOrder": "ascend"}
],
"scripts":{
"script": "
"script.param": "
"script.prerequest": "
"script.prerequest.param": "
"script.presort": "
"script.presort.param": "
},
"portal": [
"
]
},
"session":{
"token":"
"required":
}
}
---
- ### ExecuteScript
``
{
"fmServer":"
"method":"executeScript",
"methodBody":{
"database":"
"layout":"
"script": "
"param":"
},
"session":{
"token":"
"required":
}
}
---
We welcome contributions from the community. If you'd like to contribute to the fmdapi-node-weaver` npm package, please follow our Contributing Guidelines.
Copyright (c) Mindfire Digital llp. All rights reserved.
Licensed under the MIT license.