Example Node.js API using Express, TypeScript, Vue, and PostgreSQL
This example application shows how to create a Node.js Express web app using TypeScript. Please read Use TypeScript to Build a Node API with Express to see how this app was created.
- Clone or download this repository
- Install modules using
- Set up PostgreSQL with Docker. With docker installed, use the following two commands to create an instance of PostgreSQL for the application. Feel free to change the name and password for the database.
docker pull postgres:latest docker run -d --name guitar-db -p 5432:5432 -e 'POSTGRES_PASSWORD=p@ssw0rd42' postgres
.envto match your PostgreSQL server connection and credentials
Initialize the PostgreSQL database by running
npm run initdb
Create a free Okta Developer Account
Set up a new Okta application
- Click Applications in the top menu and then click "Add Application"
- Click "Web" and click Next
- Name your application, and verify the Base and Login URIs are correct. By default, the web application will run locally at http://localhost:8080. Click Done.
On the Application screen under the General tab you will find a section for "Client Credentials." You will need to copy the values for "Client ID" and "Client secret" and paste them into the
Copy the URL for your Okta developer account (e.g.
https://dev-123456-admin.oktapreview.com) and paste it into the
.envfile as the value for
-adminfrom the URL. The setting should look similar to:
To run the application in development mode:
npm run dev
By default, the web application should now be running at http://localhost:8080.
This example application uses:
Apache 2.0, see LICENSE.