{"id":27153450,"url":"https://github.com/tankengine-ish/express.js_api","last_synced_at":"2025-04-08T16:17:01.189Z","repository":{"id":215998674,"uuid":"740213917","full_name":"TankEngine-ish/Express.js_API","owner":"TankEngine-ish","description":"Express.js API [personal project]","archived":false,"fork":false,"pushed_at":"2024-01-11T14:43:54.000Z","size":1110,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-01-12T04:36:48.550Z","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/TankEngine-ish.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}},"created_at":"2024-01-07T21:03:45.000Z","updated_at":"2024-01-12T04:36:48.551Z","dependencies_parsed_at":"2024-01-07T22:38:35.557Z","dependency_job_id":null,"html_url":"https://github.com/TankEngine-ish/Express.js_API","commit_stats":null,"previous_names":["tankengine-ish/express.js_api"],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TankEngine-ish%2FExpress.js_API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TankEngine-ish%2FExpress.js_API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TankEngine-ish%2FExpress.js_API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TankEngine-ish%2FExpress.js_API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TankEngine-ish","download_url":"https://codeload.github.com/TankEngine-ish/Express.js_API/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247878013,"owners_count":21011158,"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":[],"created_at":"2025-04-08T16:17:00.575Z","updated_at":"2025-04-08T16:17:01.171Z","avatar_url":"https://github.com/TankEngine-ish.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Express.js_API\nFor my first RESTful API I used Node/Express, the nodemon package to save time on restarting the server,\nPostman to test my endpoints, Handlebars as the templating engine and some basic html and css.\n\n\n## The MVC pattern\n\nThe MVC design pattern is a popular choice among developers using Express for structuring their applications. In simplified terms:\n\nThe Controller processes the user's request and then manipulates the model accordingly.\nFor example: interacting with the Model to perform operations on the data, and sending the appropriate response.\n\nThe Model is a representation of how the Express application sees the data.\nIt involves defining data models and handling interactions with the database.\n\nThe View is how the data from the model is being presented back to the user. This is where React might step-in and take control.\n\nA simple diagram of the model:\n\n\n![Alt text](Images/mvc-framework.png)\n\nMVC is meant to simplify our code and make it easier to read, update and improve, although Express is \nnot opinionated and doesn't enforce the MVC structure.\n\n## Testing with Postman\n\nIt's worth noting that there's always a slight difference between the request time\nthat shows on our log inside the terminal and the log inside Postman. The reason is that \nit simply takes more time for the response to make it back all the way to Postman.\n\n![Alt text](\u003cImages/Screenshot from 2024-01-09 20-14-44.png\u003e)\n\nIn the shot above I was testing whether the endpoint was serving the static image content.\n\n## REST design and principles\n\n![Alt text](\u003cImages/Screenshot from 2024-01-11 16-42-44.png\u003e)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftankengine-ish%2Fexpress.js_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftankengine-ish%2Fexpress.js_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftankengine-ish%2Fexpress.js_api/lists"}