Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/uptownhr/nuxt-express-module
Add express routes to your nuxt app
https://github.com/uptownhr/nuxt-express-module
express nuxtjs vue
Last synced: about 2 months ago
JSON representation
Add express routes to your nuxt app
- Host: GitHub
- URL: https://github.com/uptownhr/nuxt-express-module
- Owner: uptownhr
- License: mit
- Created: 2018-03-28T21:15:16.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T17:17:43.000Z (about 2 years ago)
- Last Synced: 2024-08-02T01:21:48.478Z (5 months ago)
- Topics: express, nuxtjs, vue
- Language: JavaScript
- Size: 626 KB
- Stars: 61
- Watchers: 6
- Forks: 4
- Open Issues: 26
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# nuxt-express-module
[![npm (scoped with tag)](https://img.shields.io/npm/v/nuxt-express-module/latest.svg?style=flat-square)](https://npmjs.com/package/nuxt-express-module)
[![npm](https://img.shields.io/npm/dt/nuxt-express-module.svg?style=flat-square)](https://npmjs.com/package/nuxt-express-module)
[![CircleCI](https://img.shields.io/circleci/project/github/uptownhr/nuxt-express-module.svg?style=flat-square)](https://circleci.com/gh/uptownhr/nuxt-express-module)
[![Codecov](https://img.shields.io/codecov/c/github/uptownhr/nuxt-express-module.svg?style=flat-square)](https://codecov.io/gh/uptownhr/nuxt-express-module)
[![Dependencies](https://david-dm.org/uptownhr/nuxt-express-module/status.svg?style=flat-square)](https://david-dm.org/uptownhr/nuxt-express-module)
[![js-standard-style](https://img.shields.io/badge/code_style-standard-brightgreen.svg?style=flat-square)](http://standardjs.com)>
# Depricated
Everyone, I do not recommend using this module. This is no longer maintained and probably broken. I also recommend checking https://nuxtjs.org/api/configuration-servermiddleware/#usage, as Nuxt provides this as a baked in feature.[📖 **Release Notes**](./CHANGELOG.md)
## 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-module` dependency using yarn or npm to your project
- Add `nuxt-express-module` to `modules` section of `nuxt.config.js````js
{
modules: [
// Simple usage
'nuxt-express-module',// With options
['nuxt-express-module', { /* module options */ }],
]
}
``````js
// 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 install` or `npm install`
- Start development server using `npm run dev`## License
[MIT License](./LICENSE)
Copyright (c) James Lee