docs: general fixes across docs (#4737)
* docs: general fixes across docs * added deploy button to railway * fix eslint errors * fixes
This commit is contained in:
14
docs/content/development/cache/create.md
vendored
14
docs/content/development/cache/create.md
vendored
@@ -30,11 +30,11 @@ You can refer to the [Project Preparation step in the Create Module documentatio
|
||||
|
||||
## Step 1: Create the Service
|
||||
|
||||
Create the file `services/memcached-cache.ts` which will hold your cache service. Note that the name of the file is recommended to be in the format `<service_name>-cache`. So, if you’re not integrating `memcached`, you should replace the name with what’s relevant for your module.
|
||||
Create the file `src/services/memcached-cache.ts` which will hold your cache service. Note that the name of the file is recommended to be in the format `<service_name>-cache`. So, if you’re not integrating `memcached`, you should replace the name with what’s relevant for your module.
|
||||
|
||||
Add the following content to the file:
|
||||
|
||||
```ts title=services/memcached-cache.ts
|
||||
```ts title=src/services/memcached-cache.ts
|
||||
import { ICacheService } from "@medusajs/types"
|
||||
|
||||
class MemcachedCacheService implements ICacheService {
|
||||
@@ -201,12 +201,14 @@ class MemcachedCacheService implements ICacheService {
|
||||
|
||||
After implementing the cache service, you must export it so that the Medusa backend can use it.
|
||||
|
||||
Create the file `index.ts` with the following content:
|
||||
Create the file `src/index.ts` with the following content:
|
||||
|
||||
```ts title=index.ts
|
||||
```ts title=src/index.ts
|
||||
import { ModuleExports } from "@medusajs/modules-sdk"
|
||||
|
||||
import { MemcachedCacheService } from "./services"
|
||||
import {
|
||||
MemcachedCacheService,
|
||||
} from "./services/memcached-cache"
|
||||
|
||||
const service = MemcachedCacheService
|
||||
|
||||
@@ -235,7 +237,7 @@ module.exports = {
|
||||
modules: {
|
||||
// ...
|
||||
cacheService: {
|
||||
resolve: "path/to/custom-module",
|
||||
resolve: "path/to/custom-module/src/index.ts",
|
||||
options: {
|
||||
// any necessary options
|
||||
ttl: 30,
|
||||
|
||||
Reference in New Issue
Block a user