diff --git a/api/README b/api/README deleted file mode 100644 index 215c0db..0000000 --- a/api/README +++ /dev/null @@ -1,15 +0,0 @@ -This is a hack to work around limitations deploying to Vercel! - -- https://github.com/vercel/vercel/issues/4739#issuecomment-926879578 -- https://github.com/vercel/vercel/issues/3460 - -API endpoints declared in here _won't_ work during local development, but _will_ -work when deployed to production. - -Putting the endpoint here code-splits it separately from the rest of the app -bundle, so its large dependencies aren't grouped in with the others, and thereby -it just barely stays within the dependency bundle size of 50MB. It also enables -the dependencies in our `vercel-build` step to deploy with the bundle. - -If we move off Vercel, it'll be a good idea to move these endpoints back into -the /pages/api folder! diff --git a/api/assetImage.js b/pages/api/assetImage.js similarity index 100% rename from api/assetImage.js rename to pages/api/assetImage.js diff --git a/api/outfitImage.js b/pages/api/outfitImage.js similarity index 98% rename from api/outfitImage.js rename to pages/api/outfitImage.js index 8f3275b..4904757 100644 --- a/api/outfitImage.js +++ b/pages/api/outfitImage.js @@ -39,12 +39,12 @@ import fetch from "node-fetch"; import gql from "graphql-tag"; import { print as graphqlPrint } from "graphql/language/printer"; -import connectToDb from "../src/server/db"; -import { renderOutfitImage } from "../src/server/outfit-images"; +import connectToDb from "../../src/server/db"; +import { renderOutfitImage } from "../../src/server/outfit-images"; import getVisibleLayers, { petAppearanceFragmentForGetVisibleLayers, itemAppearanceFragmentForGetVisibleLayers, -} from "../src/shared/getVisibleLayers"; +} from "../../src/shared/getVisibleLayers"; const VALID_LAYER_URLS = [ /^https:\/\/(impress-asset-images\.openneo\.net|impress-asset-images\.s3\.amazonaws\.com)\/(biology|object)\/[0-9]{3}\/[0-9]{3}\/[0-9]{3}\/[0-9]+\/(150|300|600)x(150|300|600)\.png(\?[a-zA-Z0-9_-]+)?$/,