{"id":19130724,"url":"https://github.com/davicedraz/dojot-api-handler","last_synced_at":"2026-05-13T13:47:40.221Z","repository":{"id":125765896,"uuid":"157872246","full_name":"davicedraz/dojot-api-handler","owner":"davicedraz","description":"NPM package that maps the entire Dojot public API","archived":false,"fork":false,"pushed_at":"2020-04-12T17:41:15.000Z","size":38,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-01-03T11:13:05.579Z","etag":null,"topics":["dojot","iot","npm-package"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/dojot-api-handler","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davicedraz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-16T13:37:50.000Z","updated_at":"2020-04-22T13:31:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"92577fcc-374e-48e1-b720-195ab5f0031d","html_url":"https://github.com/davicedraz/dojot-api-handler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davicedraz%2Fdojot-api-handler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davicedraz%2Fdojot-api-handler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davicedraz%2Fdojot-api-handler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davicedraz%2Fdojot-api-handler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davicedraz","download_url":"https://codeload.github.com/davicedraz/dojot-api-handler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240206989,"owners_count":19765041,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dojot","iot","npm-package"],"created_at":"2024-11-09T06:12:33.514Z","updated_at":"2025-11-13T13:01:37.090Z","avatar_url":"https://github.com/davicedraz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm version](https://badge.fury.io/js/dojot-api-handler.svg)](https://badge.fury.io/js/dojot-api-handler) \n![Maintenance](https://img.shields.io/maintenance/no/2018)\n\n\n# dojot-api-handler\n\nThis is a usefull library to support any Nodejs application that intends to communicate with dojot platform. The library component maps the Dojot endpoints and lets you add the entire Dojot public API to your application. Take a look at http://www.dojot.com.br/ for more.\n\n## How to setup\n\nFirst of all, you should have a instance of Dojot platform running locally or has access to one. check the installation guide [here](https://dojotdocs.readthedocs.io/en/latest/installation-guide.html) if you don't have yet. \n\n1. Create a json config file and set, at least, the following variables:\n\n    * platformURL (has to be the URL where the Dojot platform runs on port :8000)\n    * credentials (has to be the username and password registered on platform)\n\n    ```JSON\n    {\n        \"platformURL\": \"http://localhost:8000\",\n        \"credentials\": {\n            \"username\": \"admin\",\n            \"passwd\": \"admin\"\n        }\n    }\n    ```\n\n2. Import the dojot-api-handler in main of your application.\n\n3. Set your configurations to let the library know how to operate with your Dojot instance.\n\n    ```Javascript\n    const dojot = require('dojot-api-handler');\n    const config = require('./config.json');\n\n    const dojotRouter = dojot.routes;\n    const dojotApi = dojot.api;\n\n    const apiComponents = new dojotApi(config);\n    ```\n\nThen you can build your IoT's application with your favorite tools and third-party packages and accessing the Dojot platform [endpoints](https://dojotdocs.readthedocs.io/en/latest/components-and-apis.html#exposed-apis)\n\n```Javascript\nconst dojot = require('dojot-api-handler');\nconst config = require('./config.json');\n\nconst dojotRouter = dojot.routes;\n\nconst dojotApi = dojot.api;\nconst apiComponents = new dojotApi(config);\n\nconst express = require('express');\nconst app = express();\n\napp.use(bodyParser.json());\napp.use(bodyParser.urlencoded({ extended: false }));\n\ndojotRouter(app);\n\nconst http = require('http').Server(app);\n\ndojotApi.init()\n    .then((api =\u003e {\n        http.listen(3000, () =\u003e {\n            console.log('Dojot application server listening on port 3000');\n        });\n    }));\n```\n\nNow your application is ready to receive and passes the requests to the instance of the Dojot platform it is running. Feel free to add endpoints, database and other features to your app!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavicedraz%2Fdojot-api-handler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavicedraz%2Fdojot-api-handler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavicedraz%2Fdojot-api-handler/lists"}