{"id":20348483,"url":"https://github.com/onebeyond/systemic-express","last_synced_at":"2025-04-12T01:14:47.799Z","repository":{"id":9789499,"uuid":"63348098","full_name":"onebeyond/systemic-express","owner":"onebeyond","description":"A systemic express component","archived":false,"fork":false,"pushed_at":"2025-01-23T10:55:18.000Z","size":188,"stargazers_count":1,"open_issues_count":8,"forks_count":5,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-12T01:14:43.337Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/onebeyond.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2016-07-14T15:27:51.000Z","updated_at":"2025-01-23T10:52:49.000Z","dependencies_parsed_at":"2024-02-13T10:49:16.521Z","dependency_job_id":null,"html_url":"https://github.com/onebeyond/systemic-express","commit_stats":null,"previous_names":["guidesmiths/systemic-express"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onebeyond%2Fsystemic-express","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onebeyond%2Fsystemic-express/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onebeyond%2Fsystemic-express/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onebeyond%2Fsystemic-express/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/onebeyond","download_url":"https://codeload.github.com/onebeyond/systemic-express/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248501861,"owners_count":21114684,"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":["hacktoberfest"],"created_at":"2024-11-14T22:20:40.021Z","updated_at":"2025-04-12T01:14:47.780Z","avatar_url":"https://github.com/onebeyond.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Maintainability](https://api.codeclimate.com/v1/badges/d49bb1ffdcb679b6fe37/maintainability)](https://codeclimate.com/github/onebeyond/systemic-express/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/d49bb1ffdcb679b6fe37/test_coverage)](https://codeclimate.com/github/onebeyond/systemic-express/test_coverage)\n\n# systemic-express\nA [systemic](https://github.com/guidesmiths/systemic) set of components for making easier setting up systemic-based express applications. These components are:\n\n- [app](lib/app.js)\n- [default-middleware](lib/default-middleware.js)\n- [server](lib/server.js)\n\n## App\n\nThis component contains customizable express application configuration. The whole list of options can be found [here](https://expressjs.com/en/4x/api.html#app.settings.table). \n\n```javascript\nconst System = require ('systemic');\nconst app = require('systemic-express').app\n\nnew System()\n    .configure({\n        app: {\n            // This is the default configuration\n            etag: false,\n            'x-powered-by': false,\n        }\n    })\n    .add('app', app()).dependsOn('config')\n```\n\n## Default middleware\n\nProvides two different middlewares that can be attached to the previously created application as root level middlewares. By default, this middlewares will log errors, but they can be easily overridden by passing a configuration object to the component as follows:\n\n```javascript\nconst System = require ('systemic');\nconst app = require('systemic-express').app\nconst defaultMiddleware = require('systemic-express').defaultMiddleware\n\nconst routes = require('./lib/routes')\n\nnew System()\n    .configure({\n        app: {\n            etag: false,\n            'x-powered-by': false,\n        },\n        'middleware.default': {\n            // Override default notFound error handler here    \n            notFound(err, req, res, next) {\n                // Do some not found error handling magic\n            },\n            // Override default generic error handler here\n            error(err, req, res, next) {\n                // Do some generic error handling magic\n            }\n        }\n    })\n    .add('app', app()).dependsOn('config')\n    .add('routes', routes()).dependsOn('app')\n    .add('middleware.default', defaultMiddleware()).dependsOn('routes', 'app')\n```\n\n## Server\n\nThis component makes easier to set up the express server that will expose your application. It accepts the same options as the [listen](https://expressjs.com/en/4x/api.html#app.listen) method: \n\n```js\nconst System = require('systemic')\nconst server = require('systemic-express').server\nconst app = require('systemic-express').app\nconst defaultMiddleware = require('systemic-express').defaultMiddleware\nconst routes = require('./lib/routes')\n\nnew System()\n    .configure({\n        server: {\n            // Default value\n            host: '0.0.0.0',\n            // Mandatory field\n            port: 3000\n        },\n        app: {\n            etag: true\n        }\n    })\n    .add('app', app()).dependsOn('config')\n    .add('routes', routes()).dependsOn('app')\n    .add('middleware.default', defaultMiddleware()).dependsOn('routes', 'app')\n    .add('server', server()).dependsOn('config', 'app', 'middleware.default')\n    .start((err, components) =\u003e {\n        // Do stuff with components\n    })\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonebeyond%2Fsystemic-express","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonebeyond%2Fsystemic-express","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonebeyond%2Fsystemic-express/lists"}