搜索插件、代码仓与 APP 分类

插件详情v0.0.8+3

pharaoh

Dart 的极简 Web 服务器库

AndroidiOSmacOSWindowsLinux
近 30 天下载
129
喜欢数
33
Pub 分数
110

安装插件

flutter pub add pharaoh

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

Pharaoh 是一个为 Dart 设计的极简 Web 服务器库,旨在提供轻量且高效的解决方案,用于构建 Web 服务器。它强调简单性和性能,非常适合希望以最少样板代码创建快速、可扩展后端服务的开发者。基于 Dart 的异步能力构建,Pharaoh 支持所有主要平台,包括 Android、iOS、macOS、Windows 和 Linux,实现跨平台服务器开发。其简洁的 API 可实现 RESTful 服务或简单 HTTP 处理程序的快速原型设计和部署。

适合场景

  • 构建轻量级 REST API
  • 创建跨平台后端服务
  • 原型设计网页应用
  • 开发微服务
  • 实现 HTTP 处理程序

主要特点

  • 极简设计
  • 跨平台支持
  • 异步 I/O
  • 轻量级占用
  • 简单 API
  • 高性能

适合对象

  • 寻求简洁的Dart开发者
  • 需要最小开销的项目
  • 跨平台服务器应用
  • 快速原型设计
  • 微服务架构

使用建议

  • 不适合大规模企业后端
  • 有限的内置中间件
  • 需要手动处理高级路由
  • 最适合中小型应用程序
  • 无内置数据库集成

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Pharaoh 🏇

Test Pipeline codecov Pub Version likes melos

Features

  • Robust routing
  • Focus on high performance
  • Super-high test coverage
  • HTTP helpers (just like ExpressJS)
  • Interoperability with Shelf Middlewares See here

Installing:

In your pubspec.yaml

dependencies:
  pharaoh: ^0.0.6 # requires Dart => ^3.0.0

Basic Usage:

import 'package:pharaoh/pharaoh.dart';

void main() async {

  final guestRouter = Pharaoh.router
    ..get('/user', (req, res) => res.ok("Hello World"))
    ..post('/post', (req, res) => res.json({"mee": "moo"}))
    ..put('/put', (req, res) => res.json({"pookey": "reyrey"}));

  final app = Pharaoh()
    ..use((req, res, next) => next());
    ..get('/foo', (req, res) => res.ok("bar"))
    ..group('/guest', guestRouter);

  await app.listen();
}

See the Pharaoh Examples directory for more practical use-cases.

Philosophy

Pharaoh emerges as a backend framework, inspired by the likes of ExpressJS, to empower developers in building comprehensive server-side applications using Dart. The driving force behind Pharaoh's creation is a strong belief in the potential of Dart to serve as the primary language for developing the entire architecture of a company's product. Just as the JavaScript ecosystem has evolved, Pharaoh aims to contribute to the Dart ecosystem, providing a foundation for building scalable and feature-rich server-side applications.

Contributors ✨

The Pharaoh project welcomes all constructive contributions. Contributions take many forms, from code for bug fixes and enhancements, to additions and fixes to documentation, additional tests, triaging incoming pull requests and issues, and more!

Contributing Code To Pharaoh 🛠

To setup and contribute to Pharaoh, Install Melos as a global package via pub.dev;

$ dart pub global activate melos

then initialize the workspace using the command below

$ melos bootstrap
Running Tests

To run the tests, you can either run dart test in the package you're working on or use the command below to run the full test suite:

$ melos run tests

People

List of all contributors

License

MIT

所属分类

依赖

依赖清单 14 项

源码仓库

使用此插件的项目

暂无相关数据。