0

I'm new to "Angular", "typescript" and "Electron". I created a "server.js" file with the basic example of express. What is the correct way to create a local server for the local network?

I want to create an "Angular" "Electron" App with a button to run the express server, but I don't know what to code in order to execute the "server.js" file.

function runLocalServer() {

  servidor = require('server.js');  // This line is a error!

  ....

Thanks for your help.

2
  • Can you provide some more detail as to what your Electron app is trying to achieve, what the directory structures are, and what errors you're getting? Commented Dec 27, 2017 at 18:32
  • Sorry, I just want to know how run require() from "typescript" in my Angular app inside Electron to run express. I don't know if I 'am clear. Thank you! Commented Dec 31, 2017 at 15:21

1 Answer 1

0

TypeScript accepts a normal require() as well as the import syntax. For example:

const express = require('express');
// OR
import * as express from 'express';
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.