Explorar o código

added export and return statements to examples

pKorsholm %!s(int64=3) %!d(string=hai) anos
pai
achega
c42c0153f3
Modificáronse 2 ficheiros con 8 adicións e 0 borrados
  1. 4 0
      src/api/README.md
  2. 4 0
      src/services/README.md

+ 4 - 0
src/api/README.md

@@ -12,6 +12,8 @@ export default () => {
       message: "Welcome to Medusa!"
     })
   })
+
+  return router;
 }
 ```
 
@@ -31,5 +33,7 @@ export default () => {
       message: `Welcome to ${product.title}!`
     })
   })
+
+  return router;
 }
 ```

+ 4 - 0
src/services/README.md

@@ -20,6 +20,8 @@ class MyService extends BaseService {
     return `Welcome to ${product.title}!`
   }
 }
+
+export default MyService;
 ```
 
 The first argument to the `constructor` is the global giving you access to easy dependency injection. The container holds all registered services from the core, installed plugins and from other files in the `/services` directory. The registration name is a camelCased version of the file name with the type appended i.e.: `my.js` is registered as `myService`, `custom-thing.js` is registerd as `customThingService`.
@@ -39,5 +41,7 @@ export default () => {
       message: await myService.getProductMessage()
     })
   })
+
+  return router;
 }
 ```