Alokai is a Frontend as a Service solution that simplifies composable commerce. It connects all the technologies needed to build and deploy fast & scalable ecommerce frontends. It guides merchants to deliver exceptional customer experiences quickly and easily.
middlewareModule
.
Now, the module's configuration includes cdnCacheBustingId
property, which allows you to set a unique identifier for the CDN cache busting.
The property is obligatory and must be a string.
export const { getSdk } = createSdk(
options,
({ buildModule, middlewareModule, middlewareUrl, getRequestHeaders }) => ({
example: buildModule(middlewareModule<Endpoints>, {
apiUrl: `${middlewareUrl}/test_integration`,
+ cdnCacheBustingId: process.env.CDN_CACHE_BUSTING_ID,
defaultRequestConfig: {
headers: getRequestHeaders(),
},
}),
})
);
GET
requests in default HTTP client, which was throwing an error "SDKError: Request with GET/HEAD method cannot have body". Now, the client can handle GET
requests properly.Example: Set the getProducts
method to be a GET
request by default and use custom headers.
import { initSDK, buildModule, middlewareModule } from "@vue-storefront/sdk";
import { Endpoints } from "@vsf-enterprise/sapcc-api";
const sdk = initSDK({
commerce: buildModule(middlewareModule<Endpoints>, {
apiUrl: "http://localhost:8181/commerce",
methodsRequestConfig: {
getProduct: {
method: "GET",
headers: {
"X-Header-Name": "Header-Value",
},
},
},
}),
});
createServer
. This allows you to pass additional options to cors
, body-parser
and cookie-parser
express middlewares.import { createServer } from "@vue-storefront/middleware";
import config from "../middleware.config";
createServer(config, {
cors: {
origin: "http://localhost:3000",
credentials: true,
},
bodyParser: {
limit: "50mb",
},
cookieParser: {
secret: "secret",
},
});
http://localhost:4000
to the default cors origin.middlewareModule
. Previously an invalid-json error was thrown, now undefined will be returned.