特定のオリジンからのリクエストを許可する
This commit is contained in:
parent
4cf444ab42
commit
1ceab68b42
@ -14,8 +14,12 @@ helmetDirectives['navigate-to'] = ["'self'"];
|
||||
helmetDirectives['style-src'] = ["'self'", 'https:'];
|
||||
helmetDirectives['report-uri'] = ["'self'"];
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create(AppModule, {
|
||||
cors: process.env.CORS === 'TRUE',
|
||||
const app = await NestFactory.create(AppModule);
|
||||
//XXX 特定のオリジンからのリクエストは許可する
|
||||
app.enableCors({
|
||||
origin: 'http://localhost:8180',
|
||||
methods: 'GET,PUT,POST,DELETE',
|
||||
allowedHeaders: 'Content-Type',
|
||||
});
|
||||
app.use(
|
||||
helmet({
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user