Skip to content

Add Node.js(Express) Usage Example to Docs #2405

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

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions docs/guide/essentials/history-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,29 @@ http.createServer((req, res) => {

For Node.js/Express, consider using [connect-history-api-fallback middleware](https://github.com/bripkens/connect-history-api-fallback).

##### Example
```bash
mkdir express-project
cd express-project
npm init
npm install express connect-history-api-fallback
touch app.js
```

```js
// express-project/app.js

const express = require('express')
const history = require('connect-history-api-fallback')
const app = express()
const server = app
.use(history())
.use(express.static('dist'))
.listen(80, () => {
console.log('Node.js is listening to PORT:' + server.address().port)
})
```

#### Internet Information Services (IIS)

1. Install [IIS UrlRewrite](https://www.iis.net/downloads/microsoft/url-rewrite)
Expand Down
23 changes: 23 additions & 0 deletions docs/ja/guide/essentials/history-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,29 @@ http.createServer((req, res) => {

Node.js/Express では [connect-history-api-fallback middleware](https://github.com/bripkens/connect-history-api-fallback) の利用を検討してください。

##### 利用例
```bash
mkdir express-project
cd express-project
npm init
npm install express connect-history-api-fallback
touch app.js
```

```js
// express-project/app.js

const express = require('express')
const history = require('connect-history-api-fallback')
const app = express()
const server = app
.use(history())
.use(express.static('dist'))
.listen(80, () => {
console.log('Node.js is listening to PORT:' + server.address().port)
})
```

#### Internet Information Services (IIS)

1. [IIS UrlRewrite](https://www.iis.net/downloads/microsoft/url-rewrite) をインストール
Expand Down
23 changes: 23 additions & 0 deletions docs/kr/guide/essentials/history-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,29 @@ http.createServer((req, res) => {

Node.js/Express의 경우 [connect-history-api-fallback 미들웨어](https://github.com/bripkens/connect-history-api-fallback)를 고려해보세요.

##### 예
```bash
mkdir express-project
cd express-project
npm init
npm install express connect-history-api-fallback
touch app.js
```

```js
// express-project/app.js

const express = require('express')
const history = require('connect-history-api-fallback')
const app = express()
const server = app
.use(history())
.use(express.static('dist'))
.listen(80, () => {
console.log('Node.js is listening to PORT:' + server.address().port)
})
```

#### Internet Information Services (IIS)

```
Expand Down
23 changes: 23 additions & 0 deletions docs/ru/guide/essentials/history-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,29 @@ http.createServer((req, res) => {

При использовании Node.js/Express, мы рекомендуем пользоваться [connect-history-api-fallback middleware](https://github.com/bripkens/connect-history-api-fallback).

##### пример
```bash
mkdir express-project
cd express-project
npm init
npm install express connect-history-api-fallback
touch app.js
```

```js
// express-project/app.js

const express = require('express')
const history = require('connect-history-api-fallback')
const app = express()
const server = app
.use(history())
.use(express.static('dist'))
.listen(80, () => {
console.log('Node.js is listening to PORT:' + server.address().port)
})
```

#### Internet Information Services (IIS)

1. Установить [IIS UrlRewrite](https://www.iis.net/downloads/microsoft/url-rewrite)
Expand Down
23 changes: 23 additions & 0 deletions docs/zh/guide/essentials/history-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,29 @@ http.createServer((req, res) => {

对于 Node.js/Express,请考虑使用 [connect-history-api-fallback 中间件](https://github.com/bripkens/connect-history-api-fallback)。

##### 例子
```bash
mkdir express-project
cd express-project
npm init
npm install express connect-history-api-fallback
touch app.js
```

```js
// express-project/app.js

const express = require('express')
const history = require('connect-history-api-fallback')
const app = express()
const server = app
.use(history())
.use(express.static('dist'))
.listen(80, () => {
console.log('Node.js is listening to PORT:' + server.address().port)
})
```

#### Internet Information Services (IIS)

1. 安装 [IIS UrlRewrite](https://www.iis.net/downloads/microsoft/url-rewrite)
Expand Down