Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use cors mudule? #145

Open
erickskrauch opened this issue Sep 8, 2024 · 1 comment
Open

How to use cors mudule? #145

erickskrauch opened this issue Sep 8, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@erickskrauch
Copy link

local cors = require('lib.resty.cors');

Ends with:

[error] 1#1: init_by_lua error: init_by_lua(conf.d/app.conf:8):2: module 'lib.resty.cors' not found:
       no field package.preload['lib.resty.cors']
       no file './lib/resty/cors.lua'
       no file '/usr/local/share/luajit-2.1/lib/resty/cors.lua'
       no file '/usr/local/share/lua/5.1/lib/resty/cors.lua'
       no file '/usr/local/share/lua/5.1/lib/resty/cors/init.lua'
       no file './lib/resty/cors.so'
       no file '/usr/local/lib/lua/5.1/lib/resty/cors.so'
       no file '/usr/local/lib/lua/5.1/loadall.so'
       no file './lib.so'
       no file '/usr/local/lib/lua/5.1/lib.so'
       no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
       [C]: in function 'require'
       init_by_lua(conf.d/app.conf:8):2: in main chunk
[error] init_by_lua error: init_by_lua(conf.d/app.conf:8):2: module 'lib.resty.cors' not found:
       no field package.preload['lib.resty.cors']
       no file './lib/resty/cors.lua'
       no file '/usr/local/share/luajit-2.1/lib/resty/cors.lua'
       no file '/usr/local/share/lua/5.1/lib/resty/cors.lua'
       no file '/usr/local/share/lua/5.1/lib/resty/cors/init.lua'
       no file './lib/resty/cors.so'
       no file '/usr/local/lib/lua/5.1/lib/resty/cors.so'
       no file '/usr/local/lib/lua/5.1/loadall.so'
       no file './lib.so'
       no file '/usr/local/lib/lua/5.1/lib.so'
       no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
       [C]: in function 'require'
       init_by_lua(conf.d/app.conf:8):2: in main chunk
@fabiocicerchia
Copy link
Owner

Hi @erickskrauch, thank you for raising the issue.
The cors library (https://github.com/detailyang/lua-resty-cors) is not currently available, it requires some work to bundle it into the project.

@fabiocicerchia fabiocicerchia added the enhancement New feature or request label Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants