Giter Club home page Giter Club logo

micro-template's People

Contributors

alexchopin avatar atinux avatar dependabot[bot] avatar qm3ster avatar vuchl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

micro-template's Issues

Transfert to Nuxt Community

Hi @vuchl

It was nice meeting you at VueConf!

Could you transfer the project to nuxt community? If you don't know how to, you can add me as an admin for this project so I can transfert it for you :)

Thank you

This question is available on Nuxt.js community (#c3)

Trouble with routing nuxt pages

I migrated my app from using express to micro, my API routes work fine but I can't seem to get my nuxt.render(req, res) to work.

This is my routes:

module.exports = (nuxt) => {
  return async (req, res) => {
    await dispatch()
      .dispatch('/api/echo', 'POST', echo)

      .dispatch('/api/users/register', 'POST', register)
      .dispatch('/api/users/login', 'POST', login)
      .dispatch('/api/users/edit', 'POST', editUser)

      .dispatch('/api/eracks', 'POST', newRack)
      .dispatch('/api/eracks/import', 'POST', importRacks)

      .dispatch('/api/logs/read', 'POST', readLog)
      .dispatch('/api/logs/all', 'POST', clearAllLogs)

      .dispatch('/api/carriers', 'POST', pushCarrier)

      .dispatch('/api/carriers', 'GET', getCarriers)
      .dispatch('/api/carriers/:id', 'GET', getCarrier)

      .dispatch('/api/users', 'DELETE', deleteUser)

      .dispatch('/api/eracks', 'DELETE', deleteRack)

      .dispatch('/api/logs', 'DELETE', deleteLog)

      .dispatch('/api/eracks', 'GET', getRacks)
      .dispatch('/api/eracks/:mac', 'GET', getRack)

      .dispatch('/api/configs', 'GET', getConfigs)
      .dispatch('/api/configs/sizes', 'GET', getSizes)

      .dispatch('/api/users/:id', 'GET', getUser)
      .dispatch('/api/users', 'GET', getUsers)

      .dispatch('/api/logs', 'GET', getLogs)

      .dispatch('*', 'GET', (req, res) => nuxt.render(req, res))(req, res)
  }
}

nuxt is passed from index.js:

const nuxt = new Nuxt(config)

if (nuxt.options.dev) {
  await new Builder(nuxt).build()
} else {
  await nuxt.ready()
}

const server = micro(routes(nuxt))

What happens when I try load any route that is to one of my pages, the browser tab spinner just keeps spinning. However, when I use postman to request data from my server, it works.

I tried changing micro-route to a more popular module micro-router, it somehow rendered but in the terminal it keeps saying:

(node:15776) UnhandledPromiseRejectionWarning: Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
    at ServerResponse.setHeader (_http_outgoing.js:467:11)
    at sendResponse (D:\Liang\LeetManjaro\Work\micro-nuxt\node_modules\@nuxt\server\dist\server.js:273:9)
    at errorMiddleware (D:\Liang\LeetManjaro\Work\micro-nuxt\node_modules\@nuxt\server\dist\server.js:333:5)
(node:15776) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 47871)

and a NuxtServerError page:
Capture

Template section not output in vue files

When I used the template, for some reason the vue files it created did not have <template> sections.
Looking at the source, it seems to use some kind of {{{{raw}}}} helper, presumably the one in meta.json.

If I had to guess, I'd say that function is returning undefined or perhaps an empty string.

Using vue-cli v2.9.1

This question is available on Nuxt.js community (#c4)

404 when accessing index page in production mode

I was just testing the template, no changes at all.

(node:42238) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: Request failed with status code 404
(node:42238) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

macOS Sierra
Node v7.7.3
NPM v4.1.2

This question is available on Nuxt.js community (#c5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.