Handling CORS for Express Deployed on Vercel Using vercel.json

Overview This is a memo on how to handle CORS for Express deployed on Vercel using vercel.json. Background I implemented CORS handling for the program introduced in the following article. The following was used as a reference. https://vercel.com/guides/how-to-enable-cors Method The solution is as follows. While there may be other approaches, adding headers resolved the issue. https://github.com/nakamura196/dts-typescript/commit/4c28f66b2af68950656dcb812f3e941d1b9b5feb { } " " ] " ] " ] " ] v b , r , r , h e u { } e { } e { } e { } r i w d a s l " " r " " i " " " d " " ] i d s u i s d r s d p e s h o s r s t o e e o e e r o e { { { } { } n " c e e u s c u s r s u a , " : " " s r t t r t m " r d " " " " " " : : : " c i s c i a : c e k k k v k v [ : e n " e n n e r e e e a e a 2 " " " a : " a e [ " s y y y l y l , s @ [ : t : t n : " " " " u " u r v i [ i t : : : : e : e c e " " " " " " / r n n : / [ " " " : " : i c a " " " a A A A A n e p : , : t p c c c " c " d l i r i c c c G c X e / / " " u / e e e E e - x n d / / e ( s s s T s C . o t s a . s s s , s S t d s r p * - - - O - R s e ( c i ) C C C P C F " " . / " o o o T o - , i d , n n n I n T ) n t t t t O t o " d s r r r N r k , e " o o o S o e x , l l l , l n . - - - P - , t A A A A A s l l l T l X " l l l C l - o o o H o R w w w , w e - - - D - q C O M E H u r r e L e e e i t E a s d g h T d t e i o E e e n n d , r d t " s P s - i , " O " W a , S , i l " T t s v , h " a P , , l U u T A " e " c v " c a : e l p u " t e * , " " : A } c " , c t e r p u t e - " V e } r , s i o n , C o n t e n t - L e n g t h , C o n t e n t - M D 5 , C o n t e n t - T y p e , D a t e , X - A p i - V e r s i o n " Summary I hope this serves as a helpful reference. ...

April 24, 2025 · 4 min · Nakamura

Building a Proxy Server for mdx I Object Storage

Overview This is a memo on building a proxy server for mdx I’s object storage. Background The mdx I user guide explains the following. https://docs.mdx.jp/ja/index.html#オブジェクトストレージ This is a DataDirect Networks manual describing the API specifications handled by the S3 Data Service (DDN EXAScaler S3 Data Service) provided by mdx. Please review it together with the object storage usage examples in Tips. https://docs.mdx.jp/ja/_downloads/b5d961f2c152387fa10ed951d5278f47/S3 Data Services 5.2.7 API Reference Guide.pdf I loaded this into Google NotebookLM and checked the CORS implementation status. The following is the answer. ...

March 23, 2025 · 9 min · Nakamura

CORS Configuration for Omeka S Image Server

Overview This is a note on handling CORS configuration for the Omeka S Image Server. Background In the following article, I introduced how to address CORS errors with the Omeka S IIIF Server module. While the above configuration resolved the issue of downloading IIIF manifest files, there were cases where images could not be downloaded, as shown below. A c c e s s t o i m a g e a t ' h t t p s : / / x x x / i i i f / 2 / 8 4 5 5 / f u l l / 8 6 , / 0 / d e f a u l t . j p g ' f r o m o r i g i n ' h t t p s : / / u v - v 4 . n e t l i f y . a p p ' h a s b e e n b l o c k e d b y C O R S p o l i c y : T h e ' A c c e s s - C o n t r o l - A l l o w - O r i g i n ' h e a d e r c o n t a i n s m u l t i p l e v a l u e s * , ' , b u t o n l y o n e i s a l l o w e d . This article describes how to address this issue. ...

January 27, 2025 · 3 min · Nakamura

Handling CORS Errors with Drupal's JSON:API

Overview When using the output from Drupal’s JSON:API in a separate application, a CORS error occurred. Here, I explain how to resolve the CORS error. Solution Copy the following file: /web/sites/default/default.services.yml c p / w e b / s i t e s / d e f a u l t / d e f a u l t . s e r v i c e s . y m l / w e b / s i t e s / d e f a u l t / s e r v i c e s . y m l Then, set enabled to true in cors.config: ...

June 12, 2023 · 3 min · Nakamura