mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 13:10:44 +00:00
Checkpoint (added CORS)
This commit is contained in:
@ -20,6 +20,7 @@ public class SampleJavalinServer
|
||||
private QInstance qInstance;
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
*******************************************************************************/
|
||||
@ -38,8 +39,14 @@ public class SampleJavalinServer
|
||||
qInstance = SampleMetaDataProvider.defineInstance();
|
||||
|
||||
QJavalinImplementation qJavalinImplementation = new QJavalinImplementation(qInstance);
|
||||
Javalin service = Javalin.create().start(PORT);
|
||||
Javalin service = Javalin.create(config ->
|
||||
{
|
||||
// todo - not all!!
|
||||
config.enableCorsForAllOrigins();
|
||||
}).start(PORT);
|
||||
service.routes(qJavalinImplementation.getRoutes());
|
||||
service.after(ctx ->
|
||||
ctx.res.setHeader("Access-Control-Allow-Origin", "http://localhost:3000"));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ public class SampleMetaDataProvider
|
||||
backend.setValue("port", "3306");
|
||||
backend.setValue("databaseName", "opspath");
|
||||
backend.setValue("username", "root");
|
||||
backend.setValue("password", "8BNWyoav8s79oi}Lqk");
|
||||
backend.setValue("password", "8BNWyoav8s79oi}Lqk"); // todo - load securely
|
||||
return (backend);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user