configure-express-app
Advanced tools
Comparing version 3.0.6 to 3.0.7
32
index.js
@@ -89,3 +89,3 @@ #!/usr/bin/env node | ||
console.log(`\n\n Your express app port number is : ${port ? port : 8000}`); | ||
console.log(`\n\nYour express app port number is : ${port ? port : 8000}`); | ||
@@ -97,6 +97,6 @@ const jsContent = `const express = require('express')\nconst app = express()\n\nconst helloWorldRoute = require('./app/routes/helloWorld.route'); \nconst port = ${port} | ||
\napp.get('/', (req, res) => res.send('Hello World!'))\napp.listen(port, () => console.log(\`Example app listening on port \${port\}!\\n\`)); | ||
console.log(\`Compiled successfully!\\n\`); | ||
console.log(\`You can now view ${ProjectName ? ProjectName : alterProjectName} in the browser.\\n\`); | ||
console.log(\` Local : http://localhost:8002/api/helloworld \`); | ||
console.log(\`\\nProject running successfully ! \`); | ||
\nconsole.log(\`Compiled successfully!\\n\`); | ||
\nconsole.log(\`You can now view ${ProjectName ? ProjectName : alterProjectName} in the browser.\\n\`); | ||
\nconsole.log('\\x1b[32m%s\\x1b[0m', \` Local : http://localhost:8002/api/helloworld \`); | ||
\nconsole.log(\`\\nProject running successfully ! \n\`); | ||
`; | ||
@@ -106,3 +106,3 @@ fs.writeFileSync(`./${mainFileName ? mainFileName : alterMainFilename}.js`, jsContent); | ||
const routeContent = `const express = require('express'); | ||
const router = express.Router(); | ||
\nconst router = express.Router(); | ||
\nconst helloWorld = require('../controllers/helloWorld.controller'); | ||
@@ -116,12 +116,12 @@ \nrouter.get('/helloworld', helloWorld.helloWorld); | ||
\nexports.helloWorld = async (req, res) => { | ||
\ttry { | ||
\t\tconst data = await helloWorld.helloWorld(); | ||
\t\tres.status(200).json({ | ||
\t\t\tMessage: "Hello World", | ||
\t\t\tdata: data, | ||
\t\t}); | ||
\t} catch (error) { | ||
\t\tconsole.log(error.message); | ||
\t} | ||
};` | ||
\n\ttry { | ||
\n\t\tconst data = await helloWorld.helloWorld(); | ||
\n\t\tres.status(200).json({ | ||
\n\t\t\tMessage: "Hello World", | ||
\n\t\t\tdata: data, | ||
\n\t\t}); | ||
\n\t} catch (error) { | ||
\n\t\tconsole.log(error.message); | ||
\n\t} | ||
\n};` | ||
@@ -128,0 +128,0 @@ fs.writeFileSync('./app/controllers/helloWorld.controller.js', controllerContent); |
{ | ||
"name": "configure-express-app", | ||
"version": "3.0.6", | ||
"version": "3.0.7", | ||
"description": "use npx configure-express-app", | ||
@@ -5,0 +5,0 @@ "bin": { |
6760