I encountered an issue while attempting to expose a REST service in an electron app using expressJS. Following a tutorial, I added express and @types/express to the project. However, when trying to implement a "get" method and running the build with ng build --prod
, I received the following errors:
ERROR in ./node_modules/cookie-signature/index.js Module not found: Error: Can't resolve 'crypto' in 'app\node_modules\cookie-signature' ...
This is my first time working on such a task, so please bear with me if I'm unfamiliar with some concepts.
Here is an excerpt from my package.json:
> {
"name": "angular-electron",
... (omitted for brevity)
}
The project was functioning perfectly until I integrated the express part using the following code snippet:
var app = express()
app.get('/', function (req, res) {
res.send('Hello World')
})