An example express app built using Vash
kirbysayshi / vash-express-example Goto Github PK
View Code? Open in Web Editor NEWAn example express app built using Vash
An example express app built using Vash
Took the code vash-express-example as a starting point. Made the directory structure like this
changed the code for 1 directory to look like this
I know I can change the code globally: app.set('views', path.join( __dirname, '/views') );
But I want to easily to point to views in the views/customers and views/orders
I get this error "Maximum call stack size exceeded." when using this example. If I go to ./routes/index.js and change the for loop to be smaller (like 20) it works fine.
Full error:
Connect
500 RangeError: Problem while rendering template at line 23, character 2.
Original message: Maximum call stack size exceeded.
Context:
21 | })
22 |
23 | })
24 |
at Buffer.pushConcat (c:\Users\sasmith\Source\Repos\test\vash-express-example\node_modules\vash\build\vash.js:1640:18)
at helpers.finishLayout (c:\Users\sasmith\Source\Repos\test\vash-express-example\node_modules\vash\build\vash.js:2125:25)
at Object.onRenderEnd (c:\Users\sasmith\Source\Repos\test\vash-express-example\node_modules\vash\build\vash.js:2083:9)
at eval (eval at (c:\Users\sasmith\Source\Repos\test\vash-express-example\node_modules\vash\build\vash.js:1820:24), :462:44)
at linked (c:\Users\sasmith\Source\Repos\test\vash-express-example\node_modules\vash\build\vash.js:1860:12)
at c:\Users\sasmith\Source\Repos\test\vash-express-example\node_modules\vash\build\vash.js:2082:21
at Object.vash.loadFile (c:\Users\sasmith\Source\Repos\test\vash-express-example\node_modules\vash\build\vash.js:2070:10)
at View.vash.renderFile as engine
at View.render (c:\Users\sasmith\Source\Repos\test\vash-express-example\node_modules\express\lib\view.js:126:8)
at tryRender (c:\Users\sasmith\Source\Repos\test\vash-express-example\node_modules\express\lib\application.js:639:10)
I'm newbe using Vash, but I think I found a little bug
I'm getting a UnclosedNodeError
processing this template:
@html.extend('layout', function(model){
@html.block('content', function(model){
<!-- Banner -->
<div>Hello!</div>
<!-- /Banner -->
})
})
It's due to slash /
before Banner If I remove it:
@html.extend('layout', function(model){
@html.block('content', function(model){
<!-- Banner -->
<div>Hello!</div>
<!-- Banner -->
})
})
It's works.
Hello,
I'm attempted to start a new Node.js app using Vash. I following this example. I copied the contents of app.js. My package.json is slightly different. Mine looks like this:
{
"name": "MyApp",
"version": "1.0.0",
"private": true,
"dependencies": {
"body-parser": "^1.13.3",
"cookie-parser": "^1.3.5",
"debug": "^2.2.0",
"errorhandler": "^1.4.2",
"express": "^4.13.3",
"express-session": "^1.11.3",
"method-override": "^2.3.5",
"morgan": "^1.6.1",
"multer": "^1.0.3",
"serve-favicon": "^2.3.0",
"vash": "^0.9.3"
},
"scripts": {
"start": "node app"
}
}
After running npm install
, I run node app.js
. At that point, I get an error:
/Users/username/Website/node_modules/express/lib/application.js:209
throw new TypeError('app.use() requires middleware functions');
^
TypeError: app.use() requires middleware functions
at EventEmitter.use (/Users/username/Website/node_modules/express/lib/application.js:209:11)
at Object.<anonymous> (/Users/username/Website/app.js:31:5)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
I do not understand why I am getting this error. I also do not understand how to fix it. How do I fix this error?
Thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.