create-uk-node-server 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +1 -8
  2. package/index.js +17 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -53,14 +53,7 @@ your-project/
53
53
  2. Choose your language preference
54
54
  3. Enter your project name
55
55
  4. Navigate to your project directory
56
- 5. Create `.env` file
57
-
58
- ```
59
- APP_ENV=development
60
- APP_PORT=3000
61
- APP_URL=http://localhost:3000
62
- DB_URL=mongodb://localhost:27017/your-database
63
- ```
56
+ 5. Update DB_URL in `.env` with your database connection string
64
57
  6. Run `npm start` to start your server
65
58
 
66
59
  ## License
package/index.js CHANGED
@@ -29,6 +29,23 @@ async function main() {
29
29
  console.log('success!')
30
30
  })
31
31
 
32
+ fs.createFileSync(path.join(projectPath, ".env"))
33
+ fs.createFileSync(path.join(projectPath, ".gitignore"))
34
+
35
+ fs.writeFileSync(path.join(projectPath, ".env"), `
36
+ APP_ENV=development
37
+ APP_PORT=${process.env.PORT || 3000}
38
+ APP_URL=http://localhost:${process.env.PORT || 3000}
39
+ DB_URL=mongodb://localhost:27017/your-database
40
+ `)
41
+
42
+ fs.writeFileSync(path.join(projectPath, ".gitignore"), `
43
+ .env
44
+ /node_modules
45
+ /dist
46
+ /package-lock.json
47
+ `)
48
+
32
49
  console.log(`cd ${answers.projectName} and change DB connection in .env file and run npm start`)
33
50
  }
34
51
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-uk-node-server",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "A CLI tool to quickly scaffold server projects with JavaScript or TypeScript templates",
5
5
  "main": "index.js",
6
6
  "scripts": {