Skip to content

Commit f1c9620

Browse files
committed
Move server logic into separate file
This allows us to use the following in our app. `import { app } from mu` `import app from mu/server`
1 parent 89d7f54 commit f1c9620

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

helpers/mu/index.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import express from 'express';
1+
import app from './server';
22

3-
var app = express();
3+
const mu = {
4+
app: app
5+
}
46

5-
app.listen( 80, function() {
6-
console.log('Starting server on port 80');
7-
});
8-
9-
export default app;
7+
export { app };
8+
export default mu;

helpers/mu/server.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import express from 'express';
2+
3+
var app = express();
4+
5+
app.listen( 80, function() {
6+
console.log('Starting server on port 80');
7+
});
8+
9+
export default app;

0 commit comments

Comments
 (0)