이슈
- app.ts
import Koa from 'koa';
const app = new Koa();
app.use(req => {
req.body = 'hello world';});
export default app;
- server.ts
import app from './app';
app.listen(4000, () => {
console.log("Server is Listening to port 4000");});
- Error
# ts-node-dev --respawn ./src/server.ts
TypeError: koa_1.default is not a constructor
해결
- app.ts
import * as Koa from 'koa';
'Development > Typescript' 카테고리의 다른 글
[Typescript] AsyncIterator, AsyncIterable 오류 발생시 (1) | 2023.12.23 |
---|---|
[Typescript] Graphql Health Check (0) | 2023.12.20 |
댓글