Skip to content

Commit bd59982

Browse files
committed
project apricity
1 parent a6e058a commit bd59982

File tree

23,637 files changed

+2567745
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

23,637 files changed

+2567745
-0
lines changed

.browserslistrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
> 1%
2+
last 2 versions
3+
not ie <= 8

README.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# v-template
2+
3+
## Project setup
4+
```
5+
npm install
6+
```
7+
8+
### Compiles and hot-reloads for development
9+
```
10+
npm run serve
11+
```
12+
13+
### Compiles and minifies for production
14+
```
15+
npm run build
16+
```
17+
18+
### Run your tests
19+
```
20+
npm run test
21+
```
22+
23+
### Lints and fixes files
24+
```
25+
npm run lint
26+
```
27+
28+
### Customize configuration
29+
See [Configuration Reference](https://cli.vuejs.org/config/).

app.js

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
const debug = require('debug')('e-template:server')
2+
const http = require('http')
3+
4+
const express = require('express')
5+
const path = require('path')
6+
const cookieParser = require('cookie-parser')
7+
const logger = require('morgan')
8+
9+
const app = express()
10+
11+
app.use(logger('dev'))
12+
app.use(express.json())
13+
app.use(express.urlencoded({ extended: false }))
14+
app.use(cookieParser())
15+
app.use(express.static(path.join(__dirname, 'dist')))
16+
17+
const getRouter = require('./src/routes/router')
18+
app.use('/api', getRouter)
19+
20+
/**
21+
* Get port from environment and store in Express.
22+
*/
23+
const port = normalizePort(process.env.PORT || '3000')
24+
app.set('port', port)
25+
26+
/**
27+
* Create HTTP server.
28+
*/
29+
const server = http.createServer(app)
30+
31+
/**
32+
* Listen on provided port, on all network interfaces.
33+
*/
34+
server.listen(port)
35+
server.on('error', onError)
36+
server.on('listening', onListening)
37+
38+
/**
39+
* Normalize a port into a number, string, or false.
40+
*/
41+
function normalizePort(val) {
42+
const port = parseInt(val, 10)
43+
44+
if (isNaN(port)) {
45+
// named pipe
46+
return val
47+
}
48+
49+
if (port >= 0) {
50+
// port number
51+
return port
52+
}
53+
54+
return false
55+
}
56+
57+
/**
58+
* Event listener for HTTP server "error" event.
59+
*/
60+
function onError(error) {
61+
if (error.syscall !== 'listen') {
62+
throw error
63+
}
64+
65+
const bind = typeof port === 'string'
66+
? 'Pipe ' + port
67+
: 'Port ' + port
68+
69+
// handle specific listen errors with friendly messages
70+
switch (error.code) {
71+
case 'EACCES':
72+
console.error(bind + ' requires elevated privileges')
73+
process.exit(1)
74+
break
75+
case 'EADDRINUSE':
76+
console.error(bind + ' is already in use')
77+
process.exit(1)
78+
break
79+
default:
80+
throw error
81+
}
82+
}
83+
84+
/**
85+
* Event listener for HTTP server "listening" event.
86+
*/
87+
function onListening() {
88+
const addr = server.address()
89+
const bind = typeof addr === 'string'
90+
? 'pipe ' + addr
91+
: 'port ' + addr.port
92+
debug('Listening on ' + bind)
93+
}

babel.config.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
presets: [
3+
'@vue/app'
4+
]
5+
}

0 commit comments

Comments
 (0)