{"id":15099171,"url":"https://github.com/jmgogo/api-testing","last_synced_at":"2026-02-12T01:15:17.767Z","repository":{"id":235355851,"uuid":"786218979","full_name":"jmgogo/api-testing","owner":"jmgogo","description":"Express server with various API endpoints for testing 🧪💥🤓","archived":false,"fork":false,"pushed_at":"2024-04-26T23:15:40.000Z","size":3634,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T13:40:09.483Z","etag":null,"topics":["api","cookie-session","curl","devcontainer","express","javascript","postman","sqlite"],"latest_commit_sha":null,"homepage":"","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/jmgogo.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":"2024-04-13T19:24:10.000Z","updated_at":"2024-04-26T23:15:43.000Z","dependencies_parsed_at":"2024-04-23T06:31:04.525Z","dependency_job_id":"abfd3857-67b7-4f91-b53b-54cee4cdd256","html_url":"https://github.com/jmgogo/api-testing","commit_stats":{"total_commits":39,"total_committers":1,"mean_commits":39.0,"dds":0.0,"last_synced_commit":"e823f042d5f19b5384916cfb1a45c7091220fd7c"},"previous_names":["jgome284/api-testing","jmgogo/api-testing"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jmgogo/api-testing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmgogo%2Fapi-testing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmgogo%2Fapi-testing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmgogo%2Fapi-testing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmgogo%2Fapi-testing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmgogo","download_url":"https://codeload.github.com/jmgogo/api-testing/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmgogo%2Fapi-testing/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270749194,"owners_count":24638673,"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","status":"online","status_checked_at":"2025-08-16T02:00:11.002Z","response_time":91,"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":["api","cookie-session","curl","devcontainer","express","javascript","postman","sqlite"],"created_at":"2024-09-25T17:06:59.044Z","updated_at":"2026-02-12T01:15:12.730Z","avatar_url":"https://github.com/jmgogo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Express API 🔌\n\n\u003cbr /\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/jgome284/api-testing\"\u003e\n    \u003cimg src=\"media/api-banner.jpg\" alt=\"Thoughts Webapp Banner\"\u003e\n  \u003c/a\u003e\n\n  \u003ch3 align=\"center\"\u003eForeword\u003c/h3\u003e\n\n  \u003cp align=\"center\"\u003e\n    An express server with various api endpoints for testing 🧪💥🤓\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/jgome284/api-testing/issues\"\u003eReport Bug\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/jgome284/api-testing/issues\"\u003eRequest Feature\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\n## Table of Contents\n- [Express API 🔌](#express-api-)\n  - [Table of Contents](#table-of-contents)\n  - [About](#about)\n  - [Prerequisites](#prerequisites)\n    - [Container Engine](#container-engine)\n    - [Visual Studio Code](#visual-studio-code)\n  - [Getting started](#getting-started)\n  - [Testing](#testing)\n  - [Endpoints](#endpoints)\n    - [**/expressions**](#expressions)\n      - [localhost:4000/expressions](#localhost4000expressions)\n      - [localhost:4000/expressions/:id](#localhost4000expressionsid)\n    - [**/hello**](#hello)\n      - [localhost:4000/hello](#localhost4000hello)\n    - [**/users**](#users)\n      - [localhost:4000/users](#localhost4000users)\n      - [localhost:4000/users/:id](#localhost4000usersid)\n\n## About\n\nThis project provides a simple server to test and learn about API requests. Some tools to test the API include curl if you prefer testing via your command line interface or POSTMAN which simplifies requests via a GUI. Alternatively, if you like development on VS Code, thunderclient is another viable option which can be downloaded as an extension.\n\nFor reference, sample curl requests are provided in the Endpoints section below.\n\n## Prerequisites\n\n### Container Engine\n\nThe easiest way to get started is by leveraging the devcontainer in this repo. To do so, you will need a Container Engine like Docker installed and running. For Docker, the easiest way to start the container engine is via Docker Desktop.\n\n### Visual Studio Code\n\nThe devcontainer provided is setup for use on Visual Studio Code. You should have it installed along with the [remote development pack](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack) to enable the IDE's DevContainers functionality.\n\n## Getting started\n\nTo start, open VS Code in a directory of your choice. With the terminal, clone this repository via `git clone https://github.com/jgome284/api-testing`.\n\nMake sure you have your container engine running. On VS Code, open your local copy of the project and start the development container by running `Dev Containers: Rebuild and Reopen In Container` in the command palette. It can be accessed with the keyboard shortcut `ctrl + shift + P` on your keyboard.\n\nWhen the Dev Container launches, install project dependencies via npm by executing the following command. \n\n```sh\nnpm install\n```\n\nIf successful, a `node_modules` folder should appear in your directory. To start the server for testing run the following command.\n\n```sh\nnpm start\n```\n\nThen, connect to the server on [localhost:4000](http://localhost:400) ... Make use of the endpoints listed below to practice making your own requests to the api.  Yay! (ﾉ◕ヮ◕)ﾉ*:･ﾟ🎊!\n\n## Testing\n\nTo learn more about testing, reference [this article](https://www.taniarascia.com/making-api-requests-postman-curl/), which explains API testing via POSTMAN or curl.\n\nAnother great place to try API testing is [JSONPlaceholder.com](https://jsonplaceholder.typicode.com/). It is a free online REST API that you can use whenever you need some fake data. It can be in a README on GitHub, for a demo on CodeSandbox, in code examples on Stack Overflow, ...or simply to test things locally.\n\n## Endpoints\n\nThis project's server is setup with 3 endpoints which are detailed below. To start the server run the following:\n\u003e node app.js\n\nIf successful, you should see a static site deployed at the root on `localhost:4000`.\n\n**Note:** You can use curl -i to get more information from the headers.\n\n### **/expressions**\n\n#### localhost:4000/expressions\n\n**GET** - get expressions\n\u003e curl localhost:4000/expressions\n\n**POST** - add expression\n\u003e curl -X POST localhost:4000/expressions?name=pineapple\u0026emoji=%F0%9F%8D%8D\n\n#### localhost:4000/expressions/:id\n\n**GET** - get expression from database by id\n\u003e curl localhost:4000/expressions/1\n\n**PUT** - update expression from database by id\n\u003e curl -X PUT localhost:4000/expressions/1?name=cat\u0026emoji=%F0%9F%98%BA\n\n**DELETE** - delete expression from database by id\n\u003e curl -X DELETE localhost:4000/expressions/1\n\n### **/hello**\n\n#### localhost:4000/hello\n\n**GET** - get static hello page\n\u003e curl localhost:4000/hello\n\n**Note:** A 🍪 is set at this endpoint which provides a snapshot of the amount of page views made to this route. The session cookie is set to expires at 1 minute of inactivity. A new Set-Cookie header is added on every GET request to this endpoint to extend the session lifetime. Cool! 😎\n\n### **/users**\n\n#### localhost:4000/users\n\n**GET** - get users\n\u003e curl localhost:4000/users\n\n**POST** - add user\n\u003e curl -X POST -H \"Content-Type: application/json\" -d '{\"user\": {\"username\":\"Joe Original\", \"password\":\"OriginalPassword1\"}}' localhost:4000/users\n\n#### localhost:4000/users/:id\n\n**GET** - get user from database by id\n\u003e curl localhost:4000/users/1\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmgogo%2Fapi-testing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmgogo%2Fapi-testing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmgogo%2Fapi-testing/lists"}