{"id":17051868,"url":"https://github.com/deriegle/dart-express","last_synced_at":"2025-04-12T15:21:00.645Z","repository":{"id":41883051,"uuid":"214347293","full_name":"deriegle/dart-express","owner":"deriegle","description":"Express-like HTTP framework written in Dart","archived":false,"fork":false,"pushed_at":"2024-09-26T17:51:55.000Z","size":132,"stargazers_count":38,"open_issues_count":16,"forks_count":8,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-06T13:47:22.509Z","etag":null,"topics":["api","api-rest","api-server","dart","express","expressjs","http","server-side"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/dart_express","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deriegle.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"custom":"https://www.buymeacoffee.com/deriegle"}},"created_at":"2019-10-11T05:02:08.000Z","updated_at":"2024-11-25T10:46:44.000Z","dependencies_parsed_at":"2022-08-11T20:01:09.562Z","dependency_job_id":"e58481a6-8a7d-4462-93ba-ee31f48a6576","html_url":"https://github.com/deriegle/dart-express","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deriegle%2Fdart-express","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deriegle%2Fdart-express/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deriegle%2Fdart-express/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deriegle%2Fdart-express/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deriegle","download_url":"https://codeload.github.com/deriegle/dart-express/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248586217,"owners_count":21128998,"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":["api","api-rest","api-server","dart","express","expressjs","http","server-side"],"created_at":"2024-10-14T10:07:48.037Z","updated_at":"2025-04-12T15:21:00.604Z","avatar_url":"https://github.com/deriegle.png","language":"Dart","readme":"# Dart Express ![Dart CI](https://github.com/deriegle/dart-express/workflows/Dart%20CI/badge.svg?branch=master)\n\nAn express-like web server framework for Dart developers.\n\n## Usage\n\nA simple usage example:\n\n```dart\nimport 'package:dart_express/dart_express.dart';\n\nmain() {\n  final app = express();\n\n  app.get('/', (req, res) {\n    res.json({\n      'hello': 'world',\n      'test': true,\n    });\n  });\n\n  app.listen(3000, (port) =\u003e print('Listening on port $port');\n}\n```\n\nExample with route parameters\n\n```dart\nimport 'package:dart_express/dart_express.dart';\n\nmain() {\n  final app = express();\n\n  app.get('/users/:userId/posts/:postId', (req, res) {\n    res.json({\n      'userId': req.params['userId'],\n      'postId': req.params['postId'],\n    });\n  });\n\n  app.listen(3000, (port) =\u003e print('Listening on port $port');\n}\n```\n\nWith Body parsing Middleware:\n\n```dart\nimport 'package:dart_express/dart_express.dart';\n\nmain() {\n  final app = express();\n\n  app.use(BodyParser.json());\n\n  app.post('/post', (req, res) {\n    print(req.body);\n\n    res.send({\n      'request_body': req.body,\n    });\n  });\n\n  app.listen(3000, (port) =\u003e print('Listening on port $port');\n}\n```\n\nUsing the mustache templating engine\n\n```dart\nimport 'package:dart_express/dart_express.dart';\n\nmain() {\n  final app = express();\n\n  app.use(BodyParser.json());\n  app.engine(MustacheEngine.use());\n\n  app.settings\n    ..viewsPath = 'custom_views_path'\n    ..viewEngine = 'mustache';\n\n  app.get('/', (req, res) {\n    res.render('index', {\n      'app_name': 'My Test App',\n    });\n  });\n\n  app.listen(3000, (port) =\u003e print('Listening on port $port');\n}\n```\n\n\n\nListening to Https requests\n\n```dart\n  //listen for http requests\n  app.listen(port: 80, cb: (port) =\u003e print('listening for http on port $port'));\n\n  //assign certificate\n  var context = SecurityContext();\n  final chain = Platform.script.resolve('certificates/chain.pem').toFilePath();\n  final key = Platform.script.resolve('certificates/key.pem').toFilePath();\n\n  context.useCertificateChain(chain);\n  context.usePrivateKey(key);\n\n  //listen for https requests\n  app.listenHttps(\n    context,\n    port: 443,\n    cb: (port) =\u003e print('Listening for https on port $port'),\n  );\n```\n\n\n\n### Currently supported View Engines\n\n- Basic HTML\n- Mustache\n- Markdown\n- Jael\n","funding_links":["https://www.buymeacoffee.com/deriegle"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderiegle%2Fdart-express","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fderiegle%2Fdart-express","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderiegle%2Fdart-express/lists"}