create-uk-node-server 1.0.2 → 1.0.3

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 +14 -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,20 @@ async function main() {
29
29
  console.log('success!')
30
30
  })
31
31
 
32
+ fs.writeFileSync(path.join(projectPath, ".env"), `
33
+ APP_ENV=development
34
+ APP_PORT=${process.env.PORT || 3000}
35
+ APP_URL=http://localhost:${process.env.PORT || 3000}
36
+ DB_URL=mongodb://localhost:27017/your-database
37
+ `)
38
+
39
+ fs.writeFileSync(path.join(projectPath, ".gitignore"), `
40
+ .env
41
+ /node_modules
42
+ /dist
43
+ /package-lock.json
44
+ `)
45
+
32
46
  console.log(`cd ${answers.projectName} and change DB connection in .env file and run npm start`)
33
47
  }
34
48
 
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.3",
4
4
  "description": "A CLI tool to quickly scaffold server projects with JavaScript or TypeScript templates",
5
5
  "main": "index.js",
6
6
  "scripts": {