Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8113639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:53:35+00:00 2026-06-06T02:53:35+00:00

the code in my app.coffee it uses coffee script i have put body parser

  • 0

the code in my app.coffee it uses coffee script i have put body parser and method ovveride

           express = require("express")
          everyauth = require("everyauth")
             should = require("should")
        fs = require("fs")

      everyauth.debug = true
        usersByLogin = krishna:
          login: "krishna"
          email: "krishna@blogab.com"
             password: "krishna"

          everyauth.password.loginWith("login").getLoginPath("/login").postLoginPath("        
       /login").loginView("bcore/login.jade").loginLocals((req, res, done) ->
      setTimeout (->
       done null,
           title: "blogab - login"
          ), 200
         ).authenticate((login, password) ->
      errors = []
        errors.push "Missing login"  unless login
       errors.push "Missing password"  unless password
       return errors  if errors.length
         user = usersByLogin[login]
        return [ "Login failed" ]  unless user
        return [ "Login failed" ]  if user.password isnt password
      user
       ).getRegisterPath("/register").postRegisterPath("    

         /register").registerView("bcore                 

         /register.jade").registerLocals((req, res, done) ->
      setTimeout (->
         done null,
            title: " Register"
          ), 200
           ).extractExtraRegistrationParams((req) ->
        email: req.body.email
       ).validateRegistration((newUserAttrs, errors) ->
        login = newUserAttrs.login
        errors.push "Login already taken"  if usersByLogin[login]
        errors
         ).registerUser((newUserAttrs) ->
            login = newUserAttrs[@loginKey()]
             usersByLogin[login] = newUserAttrs
           ).loginSuccessRedirect("/admin").registerSuccessRedirect "/admin"
                    app =  express.createServer

          (express.bodyParser(),express.methodOverride(),     
             express.static(__dirname + "/public"),


                 express.session(secret: "htuayreve"),  everyauth.middleware())

              express.cookieParser(), 
               app.configure ->
             app.set "view engine", "jade"

            app.get "/", (req, res) ->
         res.render "templates/default/index",
          title: "blogab"
          users: JSON.stringify(usersByLogin, null, 2)

         app.get "/admin", (req, res) ->
         res.render "bcore/admin",
         title: "Blogab-admin"
          users: JSON.stringify(usersByLogin, null, 2)

           app.get "/login", (req, res) ->
            res.render "bcore/login",
             title: "login"
             users: JSON.stringify(usersByLogin, null, 2)

               app.get "/post", (req, res) ->
                   res.render "bcore/viewpost",
                    title: "login"
                    users: JSON.stringify(usersByLogin, null, 2)

            app.get "/admin/post/new", (req, res) ->
            res.render "bcore/newpost",
           title: "Blogab-newpost"
            users: JSON.stringify(usersByLogin, null, 2)

       everyauth.helpExpress app
         app.listen 1224, ->
          console.log "blogab is  running on port %d in %s mode",
            app.address().port,   app.setting

and in newpost.jade it is the code for newpost

            !!! 5
           html(xmlns='http://www.w3.org/1999/xhtml')
           head
           title
          link(href='/css/master.css', rel='stylesheet', type='text/css')
          body
           h1
           | New post
           form#new_post.new_post(method='post', action='/posts')
             .field
              label(for='post_title') Title
               br
                 input#post_title(type='text', name='title', size='30')
           .field
              label(for='post_content') Content
            br
               textarea#post_content(name='content', cols='40', rows='20')
          .actions
              input#post_submit(type='submit', value='Create Post')
            p
               br
                 a(href='/posts') Back

when i click post it in newpost.jade it says cannot post /post and i am creating nodejs based cms i haved used express body parser and method ovveride

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T02:53:37+00:00Added an answer on June 6, 2026 at 2:53 am

    Seems like you forgot to define the POST /posts route:

    app.get '/posts', (req, res, next) ->
    

    Edited to add an example, your code was really hard to read. I wrote this:

    express = require 'express'
    app = express.createServer()
    
    app.configure ->
      app.use express.methodOverride()
      app.use express.bodyParser()
      app.use app.router
    
    app.post '/posts', (req, res) -> res.send req.body
    
    app.listen 3000
    

    $ curl localhost:3000/posts -X POST -d "param1=value1&param2=value2"

    {"param1":"value1","param2":"value2"}%

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app.js that is running express.js. I wanna convert the code to
I have this code: app = new Application(); app.Visible = false; workbook = app.Workbooks.Add(1);
I have my core web-app code in the header right now in a tag
Currently I have this code var App = Ember.Application.create(); App.user = Ember.Object.create({ people: customers
I have the following code: # app/models/part.rb class Part < ActiveRecord::Base has_many :lots #
I have an app that uses OpenGL-ES and an EAGLContext within a UIView -
Here's the relevant code: app.get('/all', function(req,res) { Party.find({},[],function(p) { console.log(p); }); res.redirect('/'); }); should
After finally getting LESS-compiling into a Node.js app with express running on coffee, I
Here's the error code: The app you are using is not responding. Please try
We are developing a hybrid mobile app (code is written in HTML and runs

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.