https://github.com/universalmediaserver/api
The metadata API that the Universal Media Server application uses
https://github.com/universalmediaserver/api
mongodb mongoose nodejs typescript
Last synced: about 2 months ago
JSON representation
The metadata API that the Universal Media Server application uses
- Host: GitHub
- URL: https://github.com/universalmediaserver/api
- Owner: UniversalMediaServer
- Created: 2019-10-01T08:02:32.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2025-04-09T18:51:03.000Z (about 2 months ago)
- Last Synced: 2025-04-09T19:43:29.369Z (about 2 months ago)
- Topics: mongodb, mongoose, nodejs, typescript
- Language: TypeScript
- Homepage:
- Size: 20.1 MB
- Stars: 10
- Watchers: 8
- Forks: 3
- Open Issues: 25
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# UMS API 
## Development
The required Node.js and Yarn versions are listed in the `package.json` file.
You can run `nvm use` and `yvm use` from the project root if you have [Node version manager](https://github.com/nvm-sh/nvm) and [Yarn version manager](https://yvm.js.org)s installed to select the correct version.
### Environment variables
- `MONGO_URL` URL to a running Mongo instance which includes user and password
- `BYPASS_MONGO` if set to `"true"`, will drop the database on each request, to get fresh data from external APIS. Use with caution.
- `UMS_API_PRIVATE_KEY_LOCATION` and `UMS_API_PUBLIC_KEY_LOCATION` optional absolute locations of SSL keys for HTTPS### Commands
#### `yarn watch`
Watches for changes to TypeScript files and compiles them to JavaScript (use `yarn run build` to do it manually)#### `yarn dev`
Runs the development server and restarts it when any file is changed#### `yarn dev:cron`
Runs the cron job feature using ts-node#### `yarn start`
Runs the server#### `yarn test`
Runs the test suite#### `yarn run start:prod`
Starts the API and cron job in production mode. TypeScript files are compiled in memory on application start.## Logs
To view the production logs:
1. Run `sudo sh -c "du -ch /var/lib/docker/containers/*/*-json.log"` to print the list of logs. Look for the biggest one and copy the container ID.
2. Run `docker logs -f --tail 100 CONTAINER_ID`## Troubleshooting
If the production server is unstable, it could be because the Docker cache is filling the hard drive. To fix it, run `docker system prune -a` to clear unused stuff.