Skip to content

Commit 6330c44

Browse files
committed
refactor: improve code formatting and update server initialization
1 parent e65905b commit 6330c44

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

‎src/index.ts

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
1-
import {app} from '@getcronit/pylon'
2-
import {serve} from '@hono/node-server'
1+
import { app } from "@getcronit/pylon";
2+
import { serve } from "@hono/node-server";
33

44
export const graphql = {
55
Query: {
66
hello: () => {
7-
return 'Hello, world!'
8-
}
7+
return "Hello, world!";
8+
},
99
},
10-
Mutation: {}
11-
}
10+
Mutation: {},
11+
};
1212

13-
serve(app, info => {
14-
console.log(`Server running at ${info.port}`)
15-
})
13+
serve(
14+
{
15+
fetch: app.fetch,
16+
port: process.env.PORT ? parseInt(process.env.PORT) : 4000,
17+
},
18+
(info) => {
19+
console.log(`Server running at ${info.port}`);
20+
}
21+
);

0 commit comments

Comments
 (0)