server_universe 0.0.1 server_universe: ^0.0.1 copied to clipboard
Serve Universal Library For Help you make server rest api on cross platform support edge functions Supabase, Vercel, Netlify, cloud Flare and more
Server Universe #
Server Universe is library for speed up and help you to make server rest api / forwarding / proxy very simple with highly customizable feature in cross platform (Server Side / Client Side) and Severless functions like (Supabase Functions, Vercel, Netlify, Cloud Flare)
Demo #
âšī¸ Information / Help / Need Update? #
This library created by poor programmers, i need more sponsor for make this library more easy, feature, documents, tutorial or speed up development this library, example so i need your support,
Please Sponsor me AZKADEV on github
i need minimal 50 Dollar / month
đī¸ Docs #
- Documentation
- Youtube
- Telegram Support Group
- Contact Developer (check social media or readme profile github)
đī¸ Features #
- â đąī¸ Cross Platform support (Device, Edge Severless functions)
- â đī¸ Standarization Style Code
- â â¨ī¸ Cli (Terminal for help you use this library or create project)
- â đĨī¸ Api (If you developer bot / userbot you can use this library without interact cli just add library and use đī¸)
- â đ§Šī¸ Customizable Extension (if you want add extension so you can more speed up on development)
- â â¨ī¸ Pretty Information (user friendly for newbie)
âī¸ Fun Fact #
This library 100% use on every my create project (App, Server, Bot, Userbot)
đī¸ Proggres #
- 2024-04-20 Starting Release Stable With core Features
- 2024-04-19 Starting create simple library Server Universe
- 2024-04-18 Think to standarization server so i can create project easy, and not only project i can add feature to my ai so my ai can create server and test direct without use rest-api, talk, searching internet or use any api
đĨī¸ Install Library #
- Dart
dart pub add server_universe_dart
- Flutter
flutter pub add server_universe_flutter
đģī¸ Install Cli #
- from pub
- from github
đī¸ Quick Start #
Example Quickstart script minimal for insight you or make you use this library because very simple
Api #
Cli #
Edge #
if you want deploy server rest api on Severless functions Like (Supabase, Cloud Flare, Deno Deploy, Vercel, Netlify)
import 'package:server_universe_dart/edge/edge.dart';
void main() async {
print("start");
ServerUniverseEdge app = ServerUniverseEdge(
onNotFound: (request, res) async {
return res.status(404).json({"@type": "error", "message": "path_not_found", "description": "PATH: ${request.path} Not Found"});
},
onError: (req, res, object, stackTrace) {
return res.status(500).json({"@type": "error", "message": "server_crash"});
},
);
app.ensureInitialized();
app.all("/", (req, res) {
return res.send("oke");
});
app.all("/version", (req, res) {
return res.json({
"@type": "version",
"version": "0.0.0",
});
});
}
Native #
if you want deploy on device or server or vps, or flutter app try this script
import 'dart:io';
import 'package:server_universe_dart/native/native.dart';
void main() async {
print("start");
int port = int.tryParse(Platform.environment["PORT"] ?? "3000") ?? 3000;
String host = Platform.environment["HOST"] ?? "0.0.0.0";
ServerUniverseNative app = ServerUniverseNative(
onNotFound: (request, res) async {
return res.json({"@type": "error", "message": "path_not_found", "description": "PATH: Not Found"});
},
onInternalError: (req, res) {
return res.json({"@type": "error", "message": "server_crash"});
},
);
app.all("/", (req, res) {
return res.send("oke");
});
app.all("/version", (req, res) {
return res.json({
"@type": "version",
"version": "0.0.0",
});
});
await app.listen(port, host);
print("Server on");
}