mirror of
https://github.com/NeteaseCloudMusicApiEnhanced/api-enhanced.git
synced 2026-06-27 21:25:08 +00:00
1.5 KiB
1.5 KiB
Agent Instructions for NeteaseCloudMusicApiEnhanced
Quick Start
- Package Manager: Use
pnpm(not npm or yarn). - Node Version: Requires Node.js 18 or later.
Developer Commands
- Install dependencies:
pnpm i - Start server:
pnpm startornode app.js - Start dev server:
pnpm dev(uses nodemon) - Run tests:
pnpm test(uses Mocha) - Linting:
pnpm lint(check) orpnpm lint-fix(auto-fix)
Architecture & Entrypoints
- Executable Server:
app.jsis the main entrypoint for running the API server. - Module Exports:
main.jsis the entrypoint when the project is imported as a Node.js dependency. - API Endpoints: Located in the
module/directory. Each file typically corresponds to an API route. - Core Utilities: Request handling, encryption, and core utilities are found in the
util/directory.
Important Gotchas & Quirks
- Environment Variables: The server defaults to port 3000 but can be overridden with the
PORTenvironment variable. - Proxy Variables: Be very careful with proxy environment variables (
http_proxy,https_proxy,no_proxy). The request library (like axios) will automatically pick these up. If they point to an unavailable proxy (especially common in Docker environments), requests will fail silently or throw connection errors. - Code Style: The project uses ESLint and Prettier. Always run
pnpm lint-fixbefore committing changes to ensure formatting consistency.