Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add TypeScript to deployment docs #1096

Merged
merged 4 commits into from
Dec 22, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,33 @@ We highly recommend using [pm2](https://github.com/Unitech/pm2/) to manage your

If you need a server.js file to be able to run `node server.js` instead of `npm run start` then create a `./server.js` file as follows:

<code-group>

<code-block title="JAVASCRIPT">

```js
const strapi = require('@strapi/strapi');
// path: `./server.js`

const strapi = require('@strapi/strapi');
strapi(/* {...} */).start();
```

</code-block>

<code-block title="TYPESCRIPT">

```ts
// path: `./server.js`

const strapi = require('@strapi/strapi');
const app = strapi({ distDir: '<path_to_your_out_dir>' });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a suggestion to keep consistency with the JS example

Suggested change
const app = strapi({ distDir: '<path_to_your_out_dir>' });
const app = strapi({ distDir: '<path_to_your_out_dir>' }).start();

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed code example

app.start();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
app.start();

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed code example

```

</code-block>

</code-group>

### Advanced configurations

If you want to host the administration on another server than the API, [please take a look at this dedicated section](/developer-docs/latest/development/admin-customization.md#deployment).
Expand Down