https://github.com/prakhardoneria/dart-compiler
https://github.com/prakhardoneria/dart-compiler
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/prakhardoneria/dart-compiler
- Owner: PrakharDoneria
- Created: 2024-08-11T13:23:24.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-07T16:46:54.000Z (about 1 year ago)
- Last Synced: 2025-04-06T07:34:08.642Z (6 months ago)
- Language: TypeScript
- Homepage:
- Size: 390 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Deno Dart Compiler Server
A simple Deno server that interfaces with the DartPad API to compile Dart code and manages code storage with expiration functionality using Deno KV.
## Endpoints
### `POST /dart`
Compiles Dart code using the DartPad API.**Request Body:**
```json
{
"code": "Your Dart code as a string"
}
```**Response:**
```json
{
"result": "Compiled JavaScript code"
}
```### `POST /save`
Saves Dart code with a unique identifier and timestamp.**Request Body:**
```json
{
"uid": "Unique identifier for the user",
"code": "Your Dart code as a string"
}
```**Response:**
```json
{
"message": "Code saved successfully"
}
```### `GET /load`
Loads saved Dart code by UID and displays it on a webpage.**Query Parameters:**
- `uid`: Unique identifier for the user.## Scheduling
The server includes a cron job that performs a daily cleanup of expired code entries. This job is scheduled to run at 12:00 IST (06:30 UTC) every day.
## Permissions
The server requires the following permissions:
- `--allow-net`: Network access for HTTP requests.
- `--allow-read`: Read access for file operations.
- `--allow-write`: Write access for file operations.
- `--allow-env`: Environment variable access.