{"id":31541355,"url":"https://github.com/techkumarnitish/express-assign","last_synced_at":"2026-02-16T10:09:23.491Z","repository":{"id":315727196,"uuid":"1060624710","full_name":"TechKumarNitish/express-assign","owner":"TechKumarNitish","description":null,"archived":false,"fork":false,"pushed_at":"2025-09-20T09:07:38.000Z","size":1,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-04T11:02:10.924Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"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/TechKumarNitish.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-20T09:05:18.000Z","updated_at":"2025-09-20T09:07:41.000Z","dependencies_parsed_at":"2025-09-21T04:06:48.762Z","dependency_job_id":null,"html_url":"https://github.com/TechKumarNitish/express-assign","commit_stats":null,"previous_names":["techkumarnitish/express-assign"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TechKumarNitish/express-assign","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechKumarNitish%2Fexpress-assign","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechKumarNitish%2Fexpress-assign/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechKumarNitish%2Fexpress-assign/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechKumarNitish%2Fexpress-assign/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TechKumarNitish","download_url":"https://codeload.github.com/TechKumarNitish/express-assign/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechKumarNitish%2Fexpress-assign/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29505686,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T09:05:14.864Z","status":"ssl_error","status_checked_at":"2026-02-16T08:55:59.364Z","response_time":115,"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":[],"created_at":"2025-10-04T11:00:23.272Z","updated_at":"2026-02-16T10:09:23.480Z","avatar_url":"https://github.com/TechKumarNitish.png","language":null,"readme":"# 📝 Simple Notes API\n\n## **Objective**\n\nCreate a basic REST API using **Express.js** to add and view notes. This is a beginner-friendly task to practice routes, middleware, and handling JSON data.\n\n---\n\n## **Requirements**\n\n### 1. Setup\n\n* Initialize Node.js project with `npm init -y`\n* Install Express: `npm install express`\n* Create `index.js` for your server\n* Server should run on **port 3000**\n* Use `express.json()` middleware for parsing JSON\n\n---\n\n### 2. Data Storage\n\n* Keep notes in memory using an array:\n\n```js\nlet notes = [];\n```\n\n---\n\n### 3. API Endpoints\n\n| Method | Endpoint | Description    | Request Body (JSON)                         |\n| ------ | -------- | -------------- | ------------------------------------------- |\n| GET    | /notes   | Get all notes  | -                                           |\n| POST   | /notes   | Add a new note | { \"title\": \"Note 1\", \"content\": \"My note\" } |\n\n---\n\n### 4. Middleware\n\n* Create a simple logger middleware to print request method and URL:\n\n```js\napp.use((req, res, next) =\u003e {\n  console.log(`${req.method} ${req.url}`);\n  next();\n});\n```\n\n---\n\n## **Bonus (Optional)**\n\n* Assign a unique `id` to each note\n* Test your API using **Postman**\n* Try adding error handling for missing fields\n\n---\n\n## **How to Run**\n\n1. Open terminal in project folder\n2. Run the server:\n\n```bash\nnode index.js\n```\n\n3. Test endpoints:\n\n   * `GET http://localhost:3000/notes`\n   * `POST http://localhost:3000/notes` with JSON body:\n\n```json\n{ \"title\": \"My Note\", \"content\": \"This is a sample note\" }\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechkumarnitish%2Fexpress-assign","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechkumarnitish%2Fexpress-assign","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechkumarnitish%2Fexpress-assign/lists"}