Turntable is an implementation of the unpkg backend interface for the Rust version. It is based on Poem and Tokio.
- Rust 1.65 or higher
- Cargo
-
Clone the repository:
git clone https://github.com/Binbiubiubiu/turntable.git
-
Build the project:
cargo build
-
Run the project:
cargo run
Turntable provides an API that allows you to access the unpkg backend interface. You can use it to fetch and serve JavaScript packages.
/
- Returns the homepage./package/:name@:version/:file
- Returns a specific file from a package./package/:name@:version/:file?meta
- Returns metadata about a specific file from a package.
-
Fetch a specific file from a package:
curl http://localhost:8000/package/[email protected]/lodash.js
-
Fetch metadata about a specific file from a package:
curl http://localhost:8000/package/[email protected]/lodash.js?meta
Contributions are welcome! Feel free to open an issue or submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.