搜尋套件、儲存庫與 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 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。