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 8940975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:11:13+00:00 2026-06-15T11:11:13+00:00

I tried localhost:3000/index.html (where I put a static page), localhost:3000/javascripts/dio.js (where I put js)

  • 0

I tried localhost:3000/index.html (where I put a static page), localhost:3000/javascripts/dio.js (where I put js)
localhost:3000/images/dio1.jpg (where I put the images),
All cannot be accessed. Why? What is wrong?

My app.js define:

var express = require('express')
var app=express()
app.bcrypt = require('bcrypt')
app.im=require('imagemagick')
app.fs=require('fs')
app.application_root = __dirname
app.path = require("path")
app.mongoose = require("mongoose")

var config=require('./config.js')(app,express)

var models = require('./models/models.js')(app.mongoose)
models.UserModel = models.UserModel
models.CommentModel = models.CommentModel
models.ItemModel = models.ItemModel

require('./routes')(app, models)

app.listen(3000);
console.log("Listening on port 3000")

Here is my config.js define:

module.exports = function(app, express, mongoose){
    var config=this

    app.configure(function (){
        app.set('views',__dirname+'/views')
        app.set('view engine','jade')
        app.set('view engine', {layout:true})

        app.use(express.bodyParser())
        app.use(express.methodOverride())
        app.use(express.cookieParser())
        app.use(express.session({secret: 'topsecret',store: new express.session.MemoryStore}))
        app.use(app.router)
        app.use(express.static(app.path.join(app.application_root+"public")))
        app.use(express.errorHandler({dumpExceptions:true,showStack:true}))
        app.use(express.bodyParser({keepExtensions: true, uploadDir:"./public/uploads"}))
    })

    /*DB part:*/
    app.mongoose.connect('mongodb://localhost/dio_database')

    return config
}
  • 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-15T11:11:14+00:00Added an answer on June 15, 2026 at 11:11 am

    Instead of concatenating and joining:

     app.path.join(app.application_root+"public")
    

    Either each part should be passed as a separate argument to path.join:

     app.path.join(app.application_root, "public")
    

    Or, if you’d rather concatenate, __dirname won’t have a trailing slash for application_root, so you’ll need to add one:

     app.application_root + '/public'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a couple static pages which when running locally work as localhost:3000/foo.html, but
Whenever I send out emails in development mode, it does not put the localhost:3000
Tried everything, can't seem to locate the issue. Error on localhost:3000 No route matches
I tried using curl syntax: curl http:// localhost:8983/solr/update/csv?stream.file=/usr/local/src/apache-solr-3.6.0/example/exampledocs/my+file.csv&separator=;&stream.contentType=text/plain;charset=utf-8 with no luck. I get: -bash:
Tried searching the site, but cannot find an answer to my problem: Lets say
I have searched and searched and I cannot find a page which spells out
My URL is as follows: http://localhost:3000/movies?ratings[PG-13]=1&commit=Refresh I'm experimenting evaluating URL params and am unsure
In config/routes.rb , I tried both: root :to => 'things#index', :as => 'things' and
This is a strange bit, When I run localhost:3000 it prompts me with error
Using Rails 3.1.1. This is my YAML file in config/app_config.yml development: &non_production_settings site_url: http://localhost:3000

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.