-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfilesData.js
140 lines (108 loc) · 2.37 KB
/
filesData.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
// server.js data
const serverCode = `import app from "./app.js"
import connectDb from "./db/connectDb.js"
import { serverPort } from './config/index.js'
// connect database
connectDb()
app.listen(serverPort, () => console.log("Server is running"))`;
// app.js data
const appCode = `import express from "express"
const app = express();
// middlewares
app.use(express.json())
app.use(express.urlencoded({ extended: true }))
export default app`;
// config data
const configCode = `import { configDotenv } from "dotenv"
configDotenv()
const serverPort = process.env.PORT || 8000
const dbUrl = process.env.DATABASE_URL
export { serverPort, dbUrl }`;
// connectDB data
const dbConnectionCode = `import mongoose from "mongoose"
import { dbUrl } from './../config/index.js'
const connectDb = async () => {
try {
await mongoose.connect(dbUrl)
console.log("Database Connected")
} catch (error) {
console.log(error.message)
}
}
export default connectDb`;
// prettierrc data
const prettierCode = `{
"tabWidth": 2,
"useTabs": false,
"semi": false,
"singleQuote": true,
"trailingComma": "es5",
"bracketSpacing": true
}`;
// prettierignore data
const prettyIgnoreCode = `/.vscode
/node modules
•/dist
*.env
.env
.env.*`;
// gitignore data
const gitIgnoreCode = `# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local
# vuepress v2.x temp and cache directory
.temp
.cache
# Serverless directories
.serverless/
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*`;
export {
serverCode,
appCode,
configCode,
dbConnectionCode,
prettierCode,
prettyIgnoreCode,
gitIgnoreCode,
};