{"id":20779513,"url":"https://github.com/mguardarini/api-rest-es6-express","last_synced_at":"2026-04-14T10:31:46.695Z","repository":{"id":123262309,"uuid":"139181235","full_name":"mguardarini/api-rest-es6-express","owner":"mguardarini","description":"API Boilerplate Rest NodeJS with ES6","archived":false,"fork":false,"pushed_at":"2018-11-21T01:25:21.000Z","size":80,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-25T22:31:58.656Z","etag":null,"topics":["api-rest","boileplate","crypto","es6","eslint","example","express","https","https-server","javascript","jest","mongodb","mysql","nodejs","nosql","ssl","ssl-certificates"],"latest_commit_sha":null,"homepage":"https://www.linkedin.com/in/mauro-guardarini-233312ab","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mguardarini.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-06-29T18:10:44.000Z","updated_at":"2018-11-21T01:25:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"9b9e6c12-760d-4f9f-829d-eca28da1fbf6","html_url":"https://github.com/mguardarini/api-rest-es6-express","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mguardarini/api-rest-es6-express","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mguardarini%2Fapi-rest-es6-express","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mguardarini%2Fapi-rest-es6-express/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mguardarini%2Fapi-rest-es6-express/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mguardarini%2Fapi-rest-es6-express/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mguardarini","download_url":"https://codeload.github.com/mguardarini/api-rest-es6-express/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mguardarini%2Fapi-rest-es6-express/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31793212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T02:24:21.117Z","status":"ssl_error","status_checked_at":"2026-04-14T02:24:20.627Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["api-rest","boileplate","crypto","es6","eslint","example","express","https","https-server","javascript","jest","mongodb","mysql","nodejs","nosql","ssl","ssl-certificates"],"created_at":"2024-11-17T13:28:17.627Z","updated_at":"2026-04-14T10:31:46.680Z","avatar_url":"https://github.com/mguardarini.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":" \u0026middot;[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)]() ![npm version](https://img.shields.io/npm/v/react.svg?style=flat)\n\n\nExpress \u0026 ES6 REST API Boilerplate\n================================== \nThis is a straightforward boilerplate for building REST APIs with ES6 and Express.\n\n- ES6 support via [babel](https://babeljs.io)\n- REST resources as middleware via [resource-router-middleware](https://github.com/developit/resource-router-middleware)\n- CORS support via [cors](https://github.com/troygoode/node-cors)\n- Body Parsing via [body-parser](https://github.com/expressjs/body-parser)\n- [Sequelize](https://github.com/sequelize/sequelize)\n- [MySQL](https://github.com/mysqljs/mysql)\n- [Crypto](https://nodejs.org/api/crypto.html)\n- [HTTPS](https://nodejs.org/api/https.html)\n\n\u003e Tip: If you are using [Mongoose](https://github.com/Automattic/mongoose), you can automatically expose your Models as REST resources using [restful-mongoose](https://git.io/restful-mongoose).\n\n```sh\n# clone it\ngit clone git@github.com:mguardarini/api-rest-es6-express.git\ncd express-es6-rest-api\n\n# Make it your own\nrm -rf .git \u0026\u0026 git init \u0026\u0026 npm init\n\n# Install dependencies\nnpm install\n\n# Start development live-reload server\nPORT=8080 npm run dev\n\n# Start production server:\nPORT=8080 npm start\n\n```\n\n# Getting Started\n\nNow, the most important part of all. Get an SSL certificate. A standard SSL certificate comes with two important files, Primary certificate and Intermediate certificate. To get an SSL, you will have to generate a CSR from your server for validation. Also we need to generate a key (private key) to maintain an HTTPS connection with the server. Running the following command in a linux environment will get us our desired mydomain.csr and private.key files.\n\n``\nopenssl req -new -newkey rsa:2048 -nodes -out mydomain.csr -keyout private.key\n``\n### Generate a Self-Signed Certificate from an Existing Private Key and CSR\n\nUse this method if you already have a private key and CSR, and you want to generate a self-signed certificate with them.\n\nThis command creates a self-signed certificate (domain.crt) from an existing private key (domain.key) and (domain.csr):\n\nPrimary Certificate\n\n``\nopenssl x509 -req -days 365 -in mydomain.csr -signkey private.key -out primary.crt\n\n``\n\nIntermediate Certificate\n\n``\nopenssl x509 -req -days 365 -in mydomain.csr -signkey private.key -out intermediate.crt\n\n``\n\nThe option(-days) specifies that the certificate will be valid for 365 days\n\n### Create Test Database\n\nFor this example i using MySQL database, so, to test you need to create a database with the name \"Test\" and create one table with the name \"Telemetry\".\n\n 1. CREATE DATABASE Test; \n 2. use Test;\n 3. CREATE TABLE Telemetry (hardwareId varchar(30), date dateTime, id int auto_increment primary key);\n\n# References:\n\n* [Creating an HTTPS Server with Node.js](https://medium.com/@nileshsingh/everything-about-creating-an-https-server-using-node-js-2fc5c48a8d4e)\n* [Generate a Self-Signed Certificate from an Existing Private Key and CSR](https://www.digitalocean.com/community/tutorials/openssl-essentials-working-with-ssl-certificates-private-keys-and-csrs)\n\n### License\n\n* MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmguardarini%2Fapi-rest-es6-express","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmguardarini%2Fapi-rest-es6-express","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmguardarini%2Fapi-rest-es6-express/lists"}