-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
executable file
·41 lines (35 loc) · 937 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env node
import chalk from 'chalk';
import inquirer from 'inquirer';
import createApp from './routes/create-app.js';
import createCrud from './routes/create-crud.js';
import createMiddleware from './routes/create-middleware.js';
async function main() {
console.log(chalk.blueBright('Welcome to express-o-matic!'));
const { mode } = await inquirer.prompt([
{
type: 'list',
message: 'What do you want to do?',
name: 'mode',
choices: [
'Create an express app',
'Create a CRUD route for my express app',
'Create a middleware',
],
},
]);
switch (mode) {
case 'Create an express app':
await createApp();
break;
case 'Create a CRUD route for my express app':
await createCrud();
break;
case 'Create a middleware':
await createMiddleware();
break;
default:
console.log('Invalid mode');
}
}
main();