{"id":20800339,"url":"https://github.com/maxtermax/rest","last_synced_at":"2026-04-28T04:02:46.385Z","repository":{"id":26396007,"uuid":"29845698","full_name":"Maxtermax/REST","owner":"Maxtermax","description":null,"archived":false,"fork":false,"pushed_at":"2015-03-10T01:48:18.000Z","size":348,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-27T13:17:00.765Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/Maxtermax.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}},"created_at":"2015-01-26T05:01:52.000Z","updated_at":"2015-03-10T01:48:18.000Z","dependencies_parsed_at":"2022-08-30T05:32:23.753Z","dependency_job_id":null,"html_url":"https://github.com/Maxtermax/REST","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Maxtermax/REST","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Maxtermax%2FREST","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Maxtermax%2FREST/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Maxtermax%2FREST/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Maxtermax%2FREST/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Maxtermax","download_url":"https://codeload.github.com/Maxtermax/REST/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Maxtermax%2FREST/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32365519,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"online","status_checked_at":"2026-04-28T02:00:07.250Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-17T18:13:30.957Z","updated_at":"2026-04-28T04:02:46.351Z","avatar_url":"https://github.com/Maxtermax.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"#Note\n Status = development\n Promises\n* FULL-REST-API\n* Secure data encryption\n* Session support\n* File support \n* Web socket real time connection\n\n# MEAN\nSimple mean stack testing repository.\n\n### Features\n  single page app, auth by web token access, model mongodb  \n\n### Install dependencies\n```\nnpm install \n```\n\n```\nbower install \n```\n\n### Start mongodb\n\n```\nmongod\n```\n\n### Run app\n```\nnode app.js\n```\n### Api usage\nRequirements, for short use the nice chrome extension  [postman](https://chrome.google.com/webstore/detail/postman-rest-client/fdmmgilgnpjigdojojpjoooidkmcomcm) or in the command line [curl](http://curl.haxx.se/) \n\n### Create account \nMake a ` POST ` request to `http://localhost:5000/sigin`, set set following fields with any value for example:\n\nname | pass     | email | \n------- | ----------| ------ |  \noctocat  | 1234 | cat@github.com |\n\n\nPostman way:\n```\nPOST /signin HTTP/1.1\nHost: localhost:5000\nCache-Control: no-cache\nPostman-Token: 61bf4ffd-a79a-362d-c372-35e36f4f7cc5\nContent-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW\n\n----WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"name\"\n\noctocat\n----WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"pass\"\n\n1234\n----WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"email\"\n\ncat@github.com\n----WebKitFormBoundary7MA4YWxkTrZu0gW\n```\n\nCurl way: \n```\ncurl -X POST -H \"Cache-Control: no-cache\" -H \"Postman-Token: efb99d48-86e3-32cf-940e-7ffe9bdf1708\" -H \"Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW\" -F \"name=octocat\" -F \"pass=1234\" -F \"email=cat@github.com\" http://localhost:5000/signin\n```\n### Server responses \nif all was right the request status gonna be something like `201` and return a json object like ,\n```\n{\n\"success\": true,\n\"message\": \"user was created with success :)\"\n} \n```\nAt db store was created the account with the specifications, note for sure the pass is encrypt with [bcrypt.js](https://www.npmjs.com/package/bcrypt)\n\nif some field is not present the server return one json object like:\n```\n{\n\"success\": false,\n\"message\": \"the request has no parameters required at body\"\n}\n```\nif the name or the pass is taken the server return:\n```\n{\n\"success\": false,\n\"message\": \"taken username or password\",\n\"err\": {\n \"name\": \"MongoError\",\n \"err\": \"E11000 duplicate key error index: MEAN.users.$name_1 dup key: { : \\\"octocat\\\" }\",\n \"code\": 11000,\n \"n\": 0,\n \"connectionId\": 482,\n \"ok\": 1\n }\n}\n```\n\n\n\n### Login  \nMake a ` PUT ` request to `http://localhost:5000/login`, set following fields with values of some account created before :\n\nname | pass     | \n------- | ----------|  \noctocat  | 1234 |\n\nPostman way:\n```\nPOST /login HTTP/1.1\nHost: localhost:5000\nCache-Control: no-cache\nPostman-Token: 9fd7835f-98cb-4d5e-1c6d-1a1fbb2448a7\nContent-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW\n\n----WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"pass\"\n\n1234\n----WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"name\"\n\noctocat\n----WebKitFormBoundary7MA4YWxkTrZu0gW\n```\nCurl way:\n```\ncurl -X POST -H \"Cache-Control: no-cache\" -H \"Postman-Token: 7f7e700e-1d17-e8b6-ca34-5a5d7997a1be\" -H \"Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW\" -F \"pass=1234\" -F \"name=octocat\" http://localhost:5000/login\n```\n### Server responses \nif all was right the request status gonna be something like `200` and return a json object like ,\n```\n{\n\"success\": true,\n\"token\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoib2N0b2NhdCIsIklEIjoiNTRjZGI1MTY5ZGUxOGQ5MDFhMWFjNThhIiwiaWF0IjoxNDIyNzY4ODc4LCJleHAiOjE0MjI3NjkxNzh9.khajdxW32CWlCikRgDMjgv1JxkY24aNVmYDti2Jge64\",\n\"message\": \"welcome login success :)\"\n}\n```\nthis object provide one token, something really important in all application because gonna be the session token, with it we can query to db from many things, this token have one expiration time similar to cookies but much more efficient, so the token expire in 5 minutes after be created.\n\n\nIf name or pass field is not present the server return one json object like:\n```\n{\n\"success\": false,\n\"message\": \"the request has no parameters required at body\"\n}\n```\n\nIf name or pass field is not present the server return one json object like:\n```\n{\n\"success\": false,\n\"message\": \"the request has no parameters required at body\"\n}\n```\n\nif the user dont exist at db the server return: \n```\n{\n\"success\": false,\n\"message\": \"user not found\"\n}\n```\n\nif the password is bad the server return:\n```\n{\n\"success\": false,\n\"message\": \"bad password\"\n}\n```\n\n\n\n### Query  \nMake a ` GET  ` request to `http://localhost:5000/u/octocat`, set the header of the request with authorization equal to the token previously created,something like this `Bearer [token]`, note the url have like param u for user and the next is the name.\n\nPostman way:\n```\nGET /u/octocat HTTP/1.1\nHost: localhost:5000\nAuthorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoiYW1pbiIsIklEIjoiNTRjZDgxNjIxZTE2ZmY5YzFmYzBkZTBkIiwiaWF0IjoxNDIyNzYyMzExLCJleHAiOjE0MjI3NjI2MTF9.yiDItEHV3s4SUHBhfSDxEMb_Mw-Q1gaAVvOA02tMKeA\nCache-Control: no-cache\nPostman-Token: 5057560b-10d4-4ac4-bcd9-8fcf98e6be64\n```\n\nCurl way:\n```\ncurl -X GET -H \"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoiYW1pbiIsIklEIjoiNTRjZDgxNjIxZTE2ZmY5YzFmYzBkZTBkIiwiaWF0IjoxNDIyNzYyMzExLCJleHAiOjE0MjI3NjI2MTF9.yiDItEHV3s4SUHBhfSDxEMb_Mw-Q1gaAVvOA02tMKeA\" -H \"Cache-Control: no-cache\" -H \"Postman-Token: 388779db-4da7-2948-824d-1671ae67206e\" http://localhost:5000/u/octocat\n```\nif the query does not have the authorization at headers from request or the token is expired or malformed or the user are different to  user with just logged so the server dont return any error, but return one limit version of the query something like:\n```\n{\n\"email\": \"octocat@github.com\",\n\"name\": \"octocat\",\n\"limit\": true\n}\n```\nthis is for [jwt](https://github.com/auth0/node-jsonwebtoken) and [express-jwt](https://github.com/auth0/express-jwt)\n\n\nif the user dont exist the server return:\n```\n{\n\"success\": false,\n\"message\": \"Ooops!\",\n \"err\": {\n \"status\": 404,\n \"success\": false,\n \"message\": \"user no found\"\n }\n}\n```\nif request dont have the method 'Bearer' into the header from request the server will return:\n```\n{\n\"success\": false,\n\"message\": \"no found Bearer [token] field in the headers of the request\"\n}\n```\nif you query the user with just logged the server return the scheme from this user:\n```\n{\n \"post\": [ ],\n \"createAt\": \"2015-02-01T05:09:42.430Z\",\n \"media\": {\n  \"video\": [ ],\n  \"audio\": [ ],\n  \"docs\": {\n   \"pdf\": [ ]\n  }\n },\n \"contactos\": [ ],\n \"email\": \"octocat@github.com\",\n \"name\": \"octocat\"\n}\n```\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### Query news \nTo get the news is required previously login and have one token so make a ` GET  ` request to `http://localhost:5000/news`, set the header of the request with authorization equal to the token previously created,something like this `Bearer [token]`. \n\nPostman way:\n```\nGET /news HTTP/1.1\nHost: localhost:5000\nAuthorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoiYW1pbiIsIklEIjoiNTRjZDgxNjIxZTE2ZmY5YzFmYzBkZTBkIiwiaWF0IjoxNDIyNzYyMzExLCJleHAiOjE0MjI3NjI2MTF9.yiDItEHV3s4SUHBhfSDxEMb_Mw-Q1gaAVvOA02tMKeA\nCache-Control: no-cache\nPostman-Token: b5e36696-4a7e-925d-6674-e61ca437d8f0\n```\n\nCurl way:\n```\ncurl -X GET -H \"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoiYW1pbiIsIklEIjoiNTRjZDgxNjIxZTE2ZmY5YzFmYzBkZTBkIiwiaWF0IjoxNDIyNzYyMzExLCJleHAiOjE0MjI3NjI2MTF9.yiDItEHV3s4SUHBhfSDxEMb_Mw-Q1gaAVvOA02tMKeA\" -H \"Cache-Control: no-cache\" -H \"Postman-Token: 42d2644e-7fe6-f46c-b197-dc20869b7529\" http://localhost:5000/news\n```\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### TODO\n File handdler, frontend desig with bootstrap,Make a better API to make http request in the frontend\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxtermax%2Frest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxtermax%2Frest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxtermax%2Frest/lists"}