Small Nest.js-based project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

14 lines
539 B

import { createOsmClient } from '../integration/geocoding/osm';
import { GeocodingProvider } from '../integration/geocoding/types';
import { createCachedDataProvider } from '../storage/cache';
import { createKeyValueStorage } from '../storage/inMemoryDB';
export const createOsmClientWithCache = (): GeocodingProvider => {
return {
geocode: createCachedDataProvider({
cacheStorage: createKeyValueStorage(20),
getNewValue: createOsmClient().geocode,
ttlMs: 86_400_000,
}),
};
};