Skip to content

Commit

Permalink
Add fake api
Browse files Browse the repository at this point in the history
  • Loading branch information
nicojs committed Mar 14, 2024
1 parent ab0117c commit 689c4b1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
11 changes: 11 additions & 0 deletions fake-api.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { createServer } from 'node:http';

const server = createServer((_, res) => {
res.end('Hello, World!');
});

// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
const port = process.env.PORT || 3000;
server.listen(port, () => {
console.log(`Listening on port ${port}`);
});
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"db:generate": "prisma generate",
"dev": "next dev",
"lint": "next lint",
"start": "next start",
"start": "node fake-api.mjs",
"typecheck": "tsc --noEmit"
},
"dependencies": {
Expand Down Expand Up @@ -47,7 +47,7 @@
},
"devDependencies": {
"@types/eslint": "^8.56.2",
"@types/node": "^20.11.20",
"@types/node": "^20.11.27",
"@types/react": "^18.2.57",
"@types/react-dom": "^18.2.19",
"@typescript-eslint/eslint-plugin": "^7.0.2",
Expand All @@ -65,4 +65,4 @@
"initVersion": "7.28.0"
},
"packageManager": "[email protected]"
}
}
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@
"**/*.cjs",
"**/*.js",
".next/types/**/*.ts"
],
, "fake-api.mjs" ],
"exclude": ["node_modules"]
}

0 comments on commit 689c4b1

Please sign in to comment.