Skip to content

Commit f525d21

Browse files
committed
Add neaps-server bin
1 parent 31298e8 commit f525d21

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

packages/api/bin/server.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env node
2+
3+
import { createApp } from "@neaps/api";
4+
5+
const port = process.env.PORT || 3000;
6+
const app = createApp();
7+
8+
app.listen(port, () => {
9+
console.log(`Neaps API listening on http://localhost:${port}`);
10+
});

packages/api/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,13 @@
1818
"files": [
1919
"dist"
2020
],
21+
"bin": {
22+
"neaps-server": "./bin/server.js"
23+
},
2124
"scripts": {
2225
"build": "tsc && tsdown",
23-
"prepack": "npm run build"
26+
"prepack": "npm run build",
27+
"start": "node bin/server.js"
2428
},
2529
"dependencies": {
2630
"neaps": "^0.2.0",

0 commit comments

Comments
 (0)