#endpoint with dot not crated during build time
2 messages · Page 1 of 1 (latest)
Based on the information provided in the extracts, Astro allows you to create custom endpoints by adding a .js or .ts file to the /pages directory. The .js or .ts extension will be removed during the build process, so the name of the file should include the extension of the data you want to create. For example, src/pages/data.json.ts will build a /data.json endpoint.
However, the extracts do not provide specific information on how to handle files that start with a dot, such as .htaccess. It's possible that Astro's build process may not support this directly due to the special handling of dotfiles in Unix-based systems.
Your current workaround of creating htaccess.ts and renaming it to .htaccess after the build seems to be a practical solution given the constraints.