MCPcopy Create free account
hub / github.com/Fibi66/FeiControl / getContentType

Function getContentType

scripts/dev-server.cjs:155–163  ·  view source on GitHub ↗
(filePath)

Source from the content-addressed store, hash-verified

153}
154
155function getContentType(filePath) {
156 if (filePath.endsWith('.js')) return 'application/javascript; charset=utf-8';
157 if (filePath.endsWith('.css')) return 'text/css; charset=utf-8';
158 if (filePath.endsWith('.woff2')) return 'font/woff2';
159 if (filePath.endsWith('.woff')) return 'font/woff';
160 if (filePath.endsWith('.json')) return 'application/json; charset=utf-8';
161 if (filePath.endsWith('.map')) return 'application/json; charset=utf-8';
162 return 'application/octet-stream';
163}
164
165function tryServeStaticAsset(request, response, distDir) {
166 const requestUrl = request.url || '/';

Callers 1

tryServeStaticAssetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected