Skip to content

Commit

Permalink
test: fix example type error.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Dec 11, 2024
1 parent f70e633 commit 85e6716
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/express/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"devDependencies": {
"@types/compression": "~1.7.2",
"@types/cookie-parser": "~1.4.2",
"@types/express": "~4.17.13",
"@types/express": "~5.0.0",
"@types/http-errors": "~2.0.1",
"nodemon": "~2.0.22",
"ts-node-dev": "~2.0.0",
Expand Down
5 changes: 4 additions & 1 deletion examples/express/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import path from 'path';
import compression from 'compression'; // compresses requests
import createError from 'http-errors';
import cookieParser from 'cookie-parser';
import express, { Express, Response, Request, NextFunction } from 'express';
import express from 'express';
import type { Express, Response, Request, NextFunction } from 'express';
import routes from './routes';

const app: Express = express();
Expand All @@ -11,9 +12,11 @@ app.disable('x-powered-by');
app.set('port', process.env.PORT || 3000);
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');
// @ts-ignore
app.use(compression());
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
// @ts-ignore
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public'), { maxAge: 31557600000 }));

Expand Down

0 comments on commit 85e6716

Please sign in to comment.