Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,14 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js 20
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: './src/package-lock.json'
node-version: 22

- name: Install dependencies
working-directory: ./src
run: npm install
run: npm install --no-audit --no-fund

- name: Run test suite
working-directory: ./src
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Google CDN Image Optimizer

[![CI](https://github.com/CDN-guy/google-cdn-image-optimization/actions/workflows/ci.yml/badge.svg)](https://github.com/CDN-guy/google-cdn-image-optimization/actions/workflows/ci.yml)
[![Node.js 20+](https://img.shields.io/badge/node-20+-green.svg)](https://nodejs.org/)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)

## Overview
A high-performance, containerized image transformation service built on **Sharp**. It provides dynamic on-the-fly image resizing, format conversion, and compression optimized for **Google Cloud CDN** and **Google Media CDN**.

Expand Down
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,9 @@ app.get('/images/*path', cache(), async (req, res, next) => {
});

// please comment this section before upload to Cloud Run
app.get('/original/*origin_path', async (req, res) => {
res.sendFile(`${__dirname}${req.path.replace("original", "images")}`);
});
// app.get('/original/*origin_path', async (req, res) => {
// res.sendFile(`${__dirname}${req.path.replace("original", "images")}`);
// });

// block any request not coming with /images/
app.get('/*others', async (req, res) => {
Expand Down
Loading