Skip to content

Commit ad5f15e

Browse files
authored
Merge pull request #1 from Shre11yeah/Shre11yeah-patch-1
Create stack.js
2 parents 710bba1 + d7db518 commit ad5f15e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

stack.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const server = require('server');
2+
const { get, post } = server.router;
3+
4+
// Launch server with options and a couple of routes
5+
server({ port: 8080 }, [
6+
get('/', ctx => 'Hello world'),
7+
post('/', ctx => {
8+
console.log(ctx.data);
9+
return 'ok';
10+
})
11+
]);

0 commit comments

Comments
 (0)