Skip to content

Commit

Permalink
feat: 添加日志
Browse files Browse the repository at this point in the history
  • Loading branch information
zzlw committed Dec 12, 2024
1 parent cc99768 commit d3d4da7
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 89 deletions.
2 changes: 2 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
API_DOMAIN=api.jiawen.live
RESOURCES=resources.jiawen.live
2 changes: 2 additions & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
API_DOMAIN=${API_DOMAIN}
RESOURCES=${RESOURCES}
24 changes: 5 additions & 19 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ module.exports = {
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
{ rel: 'dns-prefetch', href: '//resources.jiawen.live' },
{ rel: 'dns-prefetch', href: '//api.jiawen.live' },
{ rel: 'stylesheet', href: 'https://cdn.bootcss.com/aplayer/1.10.1/APlayer.min.css'}
{ rel: 'dns-prefetch', href: `//${process.env.RESOURCES}` },
{ rel: 'dns-prefetch', href: `//${process.env.API_DOMAIN}` },
{ rel: 'stylesheet', href: 'https://cdn.bootcss.com/aplayer/1.10.1/APlayer.min.css'}
],
script: [
{
async: 'async',
type: 'text/javascript',
src: 'https://resources.jiawen.live/intersection-polyfill.js'
src: `https://${process.env.RESOURCES}/intersection-polyfill.js`
},
{
async: 'async',
Expand Down Expand Up @@ -135,19 +135,5 @@ module.exports = {

styleResources: {
scss: ['./assets/scss/variables.scss', './assets/scss/mixin.scss']
},
/*
** Build configuration
*/
build: {
/*
** You can extend webpack config here
*/
extend(config, ctx) {
}
},
serverMiddleware: [
// 将日志中间件添加到 Nuxt.js 中间件中
{ path: '/api', handler: '~/serverMiddleware/logger.js' },
],
}
}
18 changes: 0 additions & 18 deletions serverMiddleware/index.js

This file was deleted.

52 changes: 0 additions & 52 deletions serverMiddleware/logger.js

This file was deleted.

0 comments on commit d3d4da7

Please sign in to comment.