nuxt-express-module
nuxt-express-module
📖 Release Notes
Features
Provides express and express/routes directory to write express routes within nuxt. The module will watch for all files within the express directory for changes and hot-reload without taking down the entire nuxt server.
Setup
- Add
nuxt-express-moduledependency using yarn or npm to your project - Add
nuxt-express-moduletomodulessection ofnuxt.config.js
{
modules: [
// Simple usage
'nuxt-express-module',
// With options
['nuxt-express-module', { /* module options */ }],
]
}
// express/routes/index.js sample
const {Router} = require('express')
const router = Router()
router.get('/api/test', (req, res) => {
res.send('hello')
})
module.exports = router
Options
expressPath
Overrides the default path of where the express directory is
routesPath
Overrides the default path of where express/routes/index.js is located
Usage
Module Description
Development
- Clone this repository
- Install dependnecies using
yarn installornpm install - Start development server using
npm run dev
License
MIT License
Copyright (c) James Lee uptownhr@gmail.com
Version History
| Version | Released | License |
|---|---|---|
| 0.0.11 | MIT | |
| 0.0.8 | MIT | |
| 0.0.6 | MIT | |
| 0.0.4 | MIT |