Collecting workspace information# Embed Service
A lightweight service to fetch and embed the latest or featured video from a YouTube channel with dynamic scaling.
- Latest Video Embed: Automatically fetches and embeds the most recent video from your YouTube channel
- Featured Video Embed: Shows the video you've set as featured on your channel
- Responsive Design: Supports custom dimensions and styling
- Easy Integration: Simple embed code for any website or platform
- API Endpoints: JSON responses for programmatic usage
- Docker Ready: Containerized for easy deployment and scaling
- GET
/app/json/latest-video: Returns JSON with embed URL for latest video - GET
/app/json/featured-video: Returns JSON with embed URL for featured video
- GET
/app/latest-video: Returns HTML iframe with the latest video- Query params:
width,height,borderRadius
- Query params:
- GET
/app/featured-video: Returns HTML iframe with the featured video- Query params:
width,height,borderRadius
- Query params:
- Node.js (v14+)
- Docker and Docker Compose (for containerized deployment)
- YouTube API Key
- YouTube Channel ID
Create a .env file based on the provided .env.example:
PORT=3000
API_KEY=your_youtube_api_key
YOUTUBE_CHANNEL_ID=your_channel_id
- Clone this repository
- Install dependencies:
npm install - Start the service:
npm start
-
Run the setup script:
./run.shThis will prompt for required environment variables if not provided.
-
For production deployment:
./deploy.sh
<!-- Default size -->
<iframe src="https://your-domain.com/app/latest-video" width="560" height="315" frameborder="0" allowfullscreen></iframe>
<!-- Custom size and border radius -->
<iframe src="https://your-domain.com/app/latest-video?width=640&height=360&borderRadius=0" width="640" height="360" frameborder="0" allowfullscreen></iframe>fetch('https://your-domain.com/app/json/latest-video')
.then(response => response.json())
.then(data => {
console.log('Embed URL:', data.embedUrl);
});MIT License