{"id":20645956,"url":"https://github.com/jakecyr/slim-node-server","last_synced_at":"2026-04-17T13:03:12.342Z","repository":{"id":57120077,"uuid":"228629788","full_name":"jakecyr/slim-node-server","owner":"jakecyr","description":"Simple and slim Node.js HTTP server","archived":false,"fork":false,"pushed_at":"2020-02-10T01:25:08.000Z","size":93,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-17T03:02:11.910Z","etag":null,"topics":["http-server","nodejs","nodejs-framework","nodejs-server","slim-framework"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/jakecyr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":null,"patreon":"jakecyr","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2019-12-17T14:05:49.000Z","updated_at":"2020-02-10T01:25:10.000Z","dependencies_parsed_at":"2022-08-23T06:30:19.617Z","dependency_job_id":null,"html_url":"https://github.com/jakecyr/slim-node-server","commit_stats":null,"previous_names":["jakecyr/simple-nodejs-server"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakecyr%2Fslim-node-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakecyr%2Fslim-node-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakecyr%2Fslim-node-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakecyr%2Fslim-node-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jakecyr","download_url":"https://codeload.github.com/jakecyr/slim-node-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242714050,"owners_count":20173581,"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":["http-server","nodejs","nodejs-framework","nodejs-server","slim-framework"],"created_at":"2024-11-16T16:22:48.810Z","updated_at":"2026-04-17T13:03:12.312Z","avatar_url":"https://github.com/jakecyr.png","language":"TypeScript","readme":"# Slim Node.js HTTP Server\n\n[![Build Status](https://travis-ci.com/jakecyr/slim-node-server.svg?branch=master)](https://travis-ci.com/jakecyr/slim-node-server)\n\n## Installation\n\n* Install the npm package `npm install slim-node-server`\n* Import the module to your project (see example below)\n\n## Usage\n\nAfter installing installing the framework, create a new instance of `Slim` and start creating your server:\n\n```javascript\n// import slim framework\nconst Slim = require('slim-node-server');\n\n// create new slim server with logging\nlet app = new Slim(true);\n\napp\n    .get('/', (req, res) =\u003e {\n        res.end('nothing here yet');\n    })\n    .get('/some-json', (req, res) =\u003e {\n        res.json({ task: 'Task 1' });\n    })\n    .listen(8080, '0.0.0.0', () =\u003e {\n        console.log('Listening');\n    });\n```\n\n### Middleware\n\n* All request types support middleware functions\n* The last function must end the response\n* All route handler functions are executed in the order they are specified\n\nExample:\n```javascript\nfunction log(req, res, next) {\n    console.log('LOG VISIT', req.url);\n    next();\n}\n\n// add middleware to log page url visited to server console\napp.get('/', log, (req, res) =\u003e {\n    res.end('Visit has been logged');\n});\n```\n\n### Query Parameters\n\nParse query parameters as needed using the `request` object in a handler function. Example:\n\n```javascript\napp.get('/echo-name', (req, res) =\u003e {\n    const queryParams = req.query();\n    res.end(queryParams.name);\n})\n```\n\n### Body Parsing\n\nParse a payload body as needed using the `request` object in a handler function. Example:\n\n```javascript\napp.post('/', async (req, res) =\u003e {\n    // wait for all payload data to parse\n    const payload = await req.body();\n\n    // echo back the payload to the client\n    res.json(payload);\n})\n```\n\n### Router\n\nRoutes can be imported from other files to reduce file size. Example:\n\n```javascript\napp\n    .addRoutes('/api', require('./routes/'))\n    .listen(8080, '0.0.0.0', () =\u003e console.log('Server listening'));\n```\n","funding_links":["https://patreon.com/jakecyr"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakecyr%2Fslim-node-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjakecyr%2Fslim-node-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakecyr%2Fslim-node-server/lists"}