Compare commits

..

No commits in common. "main" and "3.1.1" have entirely different histories.
main ... 3.1.1

7 changed files with 2767 additions and 2158 deletions

View File

@ -15,8 +15,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v6
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 'latest'

View File

@ -1,11 +1,11 @@
ARG ARCH=amd64
ARG NODE_VERSION=22
ARG NODE_VERSION=18
ARG OS=bullseye-slim
ARG ICONIFY_API_VERSION=3.2.0
ARG ICONIFY_API_VERSION=3.1.1
ARG SRC_PATH=./
#### Stage BASE ########################################################################################################
FROM --platform=${ARCH} node:${NODE_VERSION}-${OS} AS base
FROM ${ARCH}/node:${NODE_VERSION}-${OS} AS base
# This gives node.js apps access to the OS CAs
ENV NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt
@ -53,8 +53,8 @@ COPY ${SRC_PATH}icons/ /data/iconify-api/icons/
# Build API
RUN npm run build
#### Stage release #####################################################################################################
FROM iconify-api-install AS release
#### Stage RELEASE #####################################################################################################
FROM iconify-api-install AS RELEASE
ARG BUILD_DATE
ARG BUILD_VERSION
ARG BUILD_REF

0
license.txt Normal file → Executable file
View File

4848
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@
"description": "Iconify API",
"author": "Vjacheslav Trushkin",
"license": "MIT",
"version": "3.2.0",
"version": "3.1.1",
"type": "module",
"bugs": "https://github.com/iconify/api/issues",
"homepage": "https://github.com/iconify/api",
@ -11,9 +11,9 @@
"type": "git",
"url": "https://github.com/iconify/api.git"
},
"packageManager": "npm@11.6.4",
"packageManager": "npm@11.1.0",
"engines": {
"node": ">=22.20.0"
"node": ">=16.15.0"
},
"scripts": {
"build": "tsc -b",
@ -26,17 +26,17 @@
"docker:publish": "docker push iconify/api"
},
"dependencies": {
"@fastify/formbody": "^8.0.2",
"@iconify/tools": "^5.0.0",
"@fastify/formbody": "^7.4.0",
"@iconify/tools": "^4.1.1",
"@iconify/types": "^2.0.0",
"@iconify/utils": "^3.1.0",
"dotenv": "^17.2.3",
"fastify": "^5.6.2"
"@iconify/utils": "^2.3.0",
"dotenv": "^16.4.7",
"fastify": "^4.29.0"
},
"devDependencies": {
"@types/jest": "^30.0.0",
"@types/node": "^24.10.1",
"typescript": "^5.9.3",
"vitest": "^4.0.14"
"@types/jest": "^29.5.14",
"@types/node": "^20.17.17",
"typescript": "^5.7.3",
"vitest": "^3.0.5"
}
}

View File

@ -1,27 +0,0 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:recommended"],
"rangeStrategy": "bump",
"packageRules": [
{
"matchDepTypes": ["peerDependencies"],
"enabled": false
},
{
"matchPackageNames": ["fastify"],
"allowedVersions": "<4.0.0"
},
{
"matchPackageNames": ["@fastify/formbody"],
"allowedVersions": "<8.0.0"
},
{
"matchPackageNames": ["@iconify/utils"],
"allowedVersions": "<3.0.0"
},
{
"matchPackageNames": ["@iconify/tools"],
"allowedVersions": "<5.0.0"
}
]
}

View File

@ -23,9 +23,7 @@ import { errorText } from './helpers/errors.js';
export async function startHTTPServer() {
// Create HTP server
const server = fastify({
routerOptions: {
caseSensitive: true,
},
caseSensitive: true,
});
// Support `application/x-www-form-urlencoded`
@ -201,21 +199,21 @@ export async function startHTTPServer() {
// Redirect
server.get('/', (req, res) => {
res.redirect(appConfig.redirectIndex, 301);
res.redirect(301, appConfig.redirectIndex);
});
// Error handling
server.setNotFoundHandler((req, res) => {
server.setDefaultRoute((req, res) => {
res.statusCode = 404;
console.log('404:', req.url);
// Need to set custom headers because hooks don't work here
for (let i = 0; i < headers.length; i++) {
const header = headers[i];
res.header(header.key, header.value);
res.setHeader(header.key, header.value);
}
res.send();
res.end();
});
// Start it