just-another-http-api 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/api.js +1 -18
  2. package/package.json +1 -1
package/api.js CHANGED
@@ -30,24 +30,7 @@ async function createServer ( config ) {
30
30
  try {
31
31
 
32
32
  if ( config.cors ) {
33
- app.register ( require ( '@fastify/cors' ), ( instance ) => {
34
- return ( req, callback ) => {
35
- const corsOptions = {
36
- // This is NOT recommended for production as it enables reflection exploits
37
- origin: true
38
- };
39
-
40
- console.log ( 'hbawfjawhv' );
41
-
42
- // // do not include CORS headers for requests from localhost
43
- // if ( /^localhost$/m.test ( req.headers.origin ) ) {
44
- // corsOptions.origin = false;
45
- // }
46
-
47
- // callback expects two parameters: error and options
48
- callback ( null, corsOptions );
49
- };
50
- } );
33
+ app.register ( require ( '@fastify/cors' ), config.cors );
51
34
  }
52
35
  await uploads.initialiseUploads ( app, config );
53
36
  await caching.initialiseCaching ( app, config );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "just-another-http-api",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "A framework built on top of fastify aimed at removing the need for any network or server configuration. ",
5
5
  "homepage": "https://github.com/OllieEdge/just-another-http-api#readme",
6
6
  "repository": {