Comments (6)
Although I know egg server can serve a static webpage, i want to scale my client side and node.js server side separately in two docker containers managed by kubernetes. so that they are not bundled inside a same container as a single process. Kubernetes can handle scale them separately based on the resources.
from egg.
The page and the rest api have a different port, so if you request using ajax, server should return Access-Control-Allow-Origin
header.
It seems the origin
config in cors has some problem. You can try simply override the function in https://github.com/eggjs/egg-cors/blob/master/app.js#L12 and return '*' to fix it.
from egg.
@fengmk2 这个是不是放 config,这样可以直接在 config 里覆盖方法了。
https://github.com/eggjs/egg-cors/blob/master/app.js#L12
from egg.
@popomore Confirmed. It works like charm. Is it a bug in egg-kors
?
I believe if user turns on cors via exports.cors = true
inside plugin.js
. It should provide with *
as default options. Then user should be able to customize its own whitelist.
from egg.
It is not a bug. We can safely close it and we may need to document it somewhere so that other users do not run into this issue since it is not clear where to configure the whitelist.
Here is how I fixed it without modify source code of egg-cors
.
// config.local.js
module.exports = {
security: {
// value is the full url in a string format
domainWhiteList: ['http://localhost:4200']
}
};
from egg.
Why your angular app and rest api are starting at different server, the
best practice is Do everything in egg server.
We should add some view example.
Matt Ma [email protected]于2016年8月15日 周一上午11:52写道:
—
You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub
#45 (comment), or mute the
thread
https://github.com/notifications/unsubscribe-auth/AAWA1U2jEtDetB--5wqr1FvHbQvCIc4Oks5qf-JzgaJpZM4Jj8BD
.
from egg.
Related Issues (20)
- egg-router-plus 根 router 应该支持正则 HOT 1
- 能否将依赖的urllib升级为3.25的系列,而不是现在的2.41.0 HOT 2
- 怎么在没有app上下文的文件中 获取config中的配置? HOT 4
- 使用 oxlint 代替 eslint HOT 5
- egg 运行一段时间后,就会退出 HOT 1
- Track Progress of PR #5332 Towards Merging into Master
- Follow-up on PR #5334: Allow to create httpClient from app
- Track merging PR #5336 into master branch
- 服务器 egg-scrips start 无法启动,一直提示文件找不到。但是本地能正常运行 HOT 5
- Track merging of PR #5339 into master
- Track bugfix for httpclient.safeCurl typing
- eggjs返回的响应头为什么是使用小写? HOT 4
- 初始化项目跑不起来 HOT 1
- 为什么在服务启动命令中添加参数在服务生命周期中获取不到? HOT 2
- allowH2 开启的时候使用 undici v6 HOT 1
- 对于eggjs处理的咨询 HOT 1
- 点击不能跳转相关控制器和服务层函数 HOT 1
- egg-schedule启动失败 HOT 1
- 如何追踪一个请求被哪些中间件、controolers处理,以及调用了哪些services
- path-to-regexp GHSA-9wv6-86v2-598j HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from egg.