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

  • Home
  • SEARCH
  • 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 6929573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:20:07+00:00 2026-05-27T11:20:07+00:00

I have a file that creates an express server. Let’s call it foo_serever.coffee #

  • 0

I have a file that creates an express server. Let’s call it foo_serever.coffee

# foo_server.coffee
module.exports = express.createServer()

And now I want to require that and send it requests directly in javascript. (Note, sendRequest is not a real method I just want one like it)

app = require './foo_server'
app.sendRequest 'get', '/some/url.html', (status, body, headers) ->
  console.log 'yay' if status is 200

Is there a way to do this? Or do I need to spawn it as another process and send it requests over http which seems like much more of a pain.

  • 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-05-27T11:20:07+00:00Added an answer on May 27, 2026 at 11:20 am

    Short answer: No. Express only works as a real HTTP server, not a simulated one. Use a library like request for testing. You don’t have to spawn a separate process to send HTTP requests.

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

Sidebar

Related Questions

I have a piece of code that creates an SQL Server Express 2008 in
I have a Sql Server 2008 Express database file that's currently being used by
I have a program that creates a small file in the Bin directory for
I have a bash script that creates a Subversion patch file for the current
I have a method that creates a MessageDigest (a hash) from a file, and
I have a PHP app that creates a CSV file which is forced to
Hi I have a script that creates a file and stores it on the
I have a Python script that reads through a text csv file and creates
I am analyzing a .dmp file that was created and I have a call
I have an express app that I want to use the connect-form module on

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.