File tree Expand file tree Collapse file tree 4 files changed +25
-26
lines changed
generators/app/templates/src Expand file tree Collapse file tree 4 files changed +25
-26
lines changed Original file line number Diff line number Diff line change 88 handleErrors ,
99} from '@boringcodes/utils/express' ;
1010
11- import routes from './routes ' ;
11+ import components from './components ' ;
1212
1313// initialize app
1414const app = express ( ) ;
@@ -20,8 +20,8 @@ app.use(bodyParser.urlencoded({ extended: true }));
2020app . use ( bodyParser . json ( ) ) ;
2121app . use ( health ( ) ) ;
2222
23- // plug routes
24- app . use ( routes ( { dev } ) ) ;
23+ // plug components
24+ app . use ( components . path , components . routes ( { dev } ) ) ;
2525
2626// handle errors
2727app . use ( handleNotFound ) ;
Original file line number Diff line number Diff line change 1+ import { Router } from 'express' ;
2+
3+ // TODO: import components
4+ // import things from './things';
5+
6+ interface RouteOptions {
7+ readonly dev : boolean ;
8+ }
9+
10+ const path = '/' ;
11+
12+ const routes = ( _ : RouteOptions ) => {
13+ const router = Router ( ) ;
14+
15+ // TODO: register components to router
16+ // router.use(things.path, things.routes(_));
17+
18+ return router ;
19+ } ;
20+
21+ export default { path, routes } ;
22+ export { RouteOptions } ;
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments