Category "ejs"

is it possible to have a flask app and an ejs website

i am making a flask app and usually i would do the following code: from flask import ( Flask, render_template, request ) app = Flask(__name__) @

Cannot read property 'substring' of undefined in ejs

When I try to add new blog posts to my website I am continuously getting this error: TypeError: C:\Users\shruti\Desktop\ejs-challenge\views\home.ejs:15 13| 14|

Divs inside my ejs loop are not rendering

<div style="display: flex; flex-wrap: wrap; justify-content: center;"> <% guser._roles.forEach(async el => { let urole = await guild.roles.cache.g

how to define this variable "usersWithSecret is not defined" in app.js?

app.get('/secrets', function(req, res){ User.find({'secret': {$ne: null}}, function(err, foundUser){ if(err){ console.log(err); } else{ if(foundUser){

how do I use for loop inside script tag in ejs

I try to draw chart, using chart.js. To get my data, I try to use ejs tags for example, in ejs I input html like this, and it works well. <p>date

How to store and update variable in ejs, access it on different routes

I am absolute beginner concerning javascript, express, node, ejs, etc, please go easy on me. :D I am creating a website, which is a gallery of my projects. You

can I use partials in a for loop in ejs?

I'm trying to include partials in a for loop in EJS. <% let index = 1 %> <% for (let item in db) { %> <div class="box unfocused box_<

Failed to lookup view "index.ejs" in views directory

I have the following code in my express app (app.js file): const express = require("express"); const app = express(); app.set('view engine', 'ejs'); app.get(

Failed to lookup view "index" in views directory

I am trying to learn node.js. I have the following code. var express = require('express'); var app = express(); var port = process.env.PORT || 5000; app.use

include of header and footer in ejs file not working

guys I'm working on a node/express app in cloud 9. https://webdevcamp-miatech.c9users.io/ however, the include files in my home.ejs file are not working. I have

Why is my CSS is not working for all my EJS loops?

I have a forEach loop that loops through my seeded Mongo database. Everything is working as it should, except one of my CSS functions that come from a jQuery fi

How to pass flash messages in ejs view

index.js /** * Created by sysadmin on 1/25/2017. */ var express = require('express'); var router = express.Router(); var request = require('request'); var s

Node.js - EJS - including a partial

I am trying to use Embedded Javascript renderer for node: https://github.com/visionmedia/ejs I would like to know how I can include another view file (partial