diff --git a/docs/docs/serve-files.md b/docs/docs/serve-files.md index a2726cdb407..202e2bc48db 100644 --- a/docs/docs/serve-files.md +++ b/docs/docs/serve-files.md @@ -7,7 +7,7 @@ meta: --- # Serve files -To serve static files such as images, CSS files, and JavaScript files, Ts.ED use `express.static` and `koa-send` for Express and Koa respectively. +To serve static files such as images, CSS files, and JavaScript files, Ts.ED uses `express.static` and `koa-send` for Express and Koa respectively. ## Configuration @@ -43,7 +43,7 @@ http://localhost:3000/images/bg.png http://localhost:3000/hello.html ``` -To create a virtual path prefix (where the path does not actually exist in the file system) for files that are served by the Ts.ED, specify a mount path for the static directory, as shown below: +To create a virtual path prefix (where the path does not actually exist in the file system) for files that are served by Ts.ED, specify a mount path for the static directory, as shown below: ```typescript import {Configuration} from "@tsed/common"; @@ -75,7 +75,7 @@ http://localhost:3000/static/hello.html ## Statics options -Statics options depend on which platform your work (Express, Koa, etc...). +Statics options depend on which platform you work (Express, Koa, etc...). @@ -117,7 +117,7 @@ interface KoaStaticsOptions { ## Expose a webapp Exposing a webapp (React, Vue.js, Angular) with Ts.ED is quite possible. -The configuration can be a bit complicated because you have to add the right headers and redirection rule so that all queries are redirected to your webapp when the urls is managed by your front-end application. +The configuration can be a bit complicated because you have to add the right headers and redirection rule so that all queries are redirected to your webapp when the urls are managed by your front-end application. Here is a small example to configure statics directory with the right headers and redirection rules. diff --git a/docs/docs/templating.md b/docs/docs/templating.md index 02c9634a257..fd3e5bbaf05 100644 --- a/docs/docs/templating.md +++ b/docs/docs/templating.md @@ -1,7 +1,7 @@ --- meta: - name: description - content: Use template engine with Ts.ED by using decorators. Ts.ED is built on top of Express/Koa and use TypeScript language. + content: Use template engine with Ts.ED by using decorators. Ts.ED is built on top of Express/Koa and uses TypeScript language. - name: keywords content: template engine consolidate ts.ed express typescript node.js javascript decorators --- @@ -15,7 +15,7 @@ This decorator will use the data returned by the method, and the configured view ## Configuration Ts.ED is using [consolidate](https://github.com/tj/consolidate.js) under the hood. -The default, template engine installed with Ts.ED is [EJS](https://ejs.co/). +The default template engine installed with Ts.ED is [EJS](https://ejs.co/). If you want to use another engine, please refer to the engine documentation and [consolidate](https://github.com/tj/consolidate.js) to install the engine correctly. <<< @/docs/docs/snippets/templating/configuration.ts @@ -33,7 +33,7 @@ export interface PlatformViewsSettings { */ root?: string; /** - * Enable cache. Ts.ED enable cache in PRODUCTION profile by default. + * Enable cache. Ts.ED enables cache in PRODUCTION profile by default. */ cache?: boolean; /** @@ -77,14 +77,14 @@ Here is an example of a controller using the @@View@@ decorator: ::: tip -Like Express.js or Koa.js, @@View@@ decorator use `express.response.locals` or `koa.context.state` to populate data before +Like Express.js or Koa.js, @@View@@ decorator uses `express.response.locals` or `koa.context.state` to populate data before rendering the template. See [Locals](/docs/controllers.html#locals) decorator usage for more information. ::: ### With render method -It's also possible to render a views by injecting and using @@PlatformResponse@@ instance. +It's also possible to render a view by injecting and using @@PlatformResponse@@ instance. @@ -106,18 +106,18 @@ It's also possible to render a views by injecting and using @@PlatformResponse@@ ### With PlatformViews -Ts.ED provides the @@PlatformViews@@ service to render views. In fact, @@View@@ decorator use `PlatformResponse.render()` method which itself uses the `PlatformViews.render()` method. -It useful, if you want render a template from a service. +Ts.ED provides the @@PlatformViews@@ service to render views. In fact, @@View@@ decorator uses `PlatformResponse.render()` method which itself uses the `PlatformViews.render()` method. +It is useful if you want to render a template from a service. <<< @/docs/docs/snippets/templating/template-platform-views.ts ## Caching -To enable caching simply pass `{ cache: true }` to the @@View@@ decorator. -All engines that consolidate.js implements I/O for will cache the file contents, ideal for production environments. +To enable caching, simply pass `{ cache: true }` to the @@View@@ decorator. +All engines that consolidate.js implements I/O for, will cache the file contents, ideal for production environments. <<< @/docs/docs/snippets/templating/template-cache.ts ::: tip -Ts.ED enable cache by default in `PRODUCTION` profile. -::: \ No newline at end of file +Ts.ED enables cache by default in `PRODUCTION` profile. +::: diff --git a/docs/docs/upload-files.md b/docs/docs/upload-files.md index 770eb0eed9a..54473a3e71c 100644 --- a/docs/docs/upload-files.md +++ b/docs/docs/upload-files.md @@ -11,13 +11,13 @@ projects: --- # Upload files -Ts.ED support now the uploading files by default. We use [Multer](https://github.com/expressjs/multer) module +Ts.ED supports now the uploading files by default. We use [Multer](https://github.com/expressjs/multer) module to handle `multipart/form-data` from request. ::: tip -Originally, multer is provided by Express.js, but Ts.ED implement a multer wrapper to support Koa.js platform based on the official [@koa/multer](https://www.npmjs.com/package/@koa/multer) module. +Originally, multer is provided by Express.js, but Ts.ED implements a multer wrapper to support Koa.js platform based on the official [@koa/multer](https://www.npmjs.com/package/@koa/multer) module. ::: ## Configuration diff --git a/docs/tutorials/socket-io.md b/docs/tutorials/socket-io.md index 8d5a55aaa01..65dd26ddd1c 100644 --- a/docs/tutorials/socket-io.md +++ b/docs/tutorials/socket-io.md @@ -84,7 +84,7 @@ Example: <<< @/docs/tutorials/snippets/socketio/socket-send-response.ts ::: tip -All methods accepts a promise as returned value. Ts.ED handle promise before returning a response to your consumer. +All methods accept a promise as returned value. Ts.ED handles promise before returning a response to your consumer. ::: ::: warning @@ -143,4 +143,4 @@ Middlewares chain uses the `Promise` to run it. If one of this middlewares/metho ## Maintainers - \ No newline at end of file + diff --git a/docs/tutorials/typeorm.md b/docs/tutorials/typeorm.md index dde7ed562a2..891995e0ef3 100644 --- a/docs/tutorials/typeorm.md +++ b/docs/tutorials/typeorm.md @@ -79,12 +79,12 @@ We can use this model with a Controller like that: ## EntityRepository You can create a custom repository which should contain methods to work with your database. -Usually custom repositories are created for a single entity and contains its specific queries. +Usually custom repositories are created for a single entity and contain their specific queries. For example, let's say we want to have a method called `findByName(firstName: string, lastName: string)` which will search for users by a given first and last names. The best place for this method is in Repository, so we could call it like `userRepository.findByName(...)`. You can achieve this using custom repositories. -`@tsed/typeorm` plugin configures the DI so that repositories declared for TypeORM can be injected into a Ts.ED controller or service +`@tsed/typeorm` plugin configures the DI so that repositories declared for TypeORM can be injected into a Ts.ED controller or service. The first way to create a custom repository is to extend Repository. Example: @@ -110,4 +110,4 @@ Use @@UseConnection@@ decorator to select which database connection the injected Become maintainer - \ No newline at end of file +