mirror of
https://github.com/goldbergyoni/nodebestpractices.git
synced 2025-10-27 10:55:55 +08:00
use import in typescript instead of require
This commit is contained in:
@ -80,7 +80,7 @@ request(app)
|
|||||||
<summary><strong>Typescript</strong></summary>
|
<summary><strong>Typescript</strong></summary>
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
const request = require('supertest');
|
import * as request from "supertest";
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
app.get('/user', (req: Request, res: Response) => {
|
app.get('/user', (req: Request, res: Response) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user