This is a simple API for HotelXpress, providing essential functionalities to manage hotel operations.
To create an admin user, you need a key, the key are web
,nice
, hei
or web_wizards
for the moments.
To run the server locally, you need to make some configurations:
#database configuration
DATABASE_URL="postgresql://postgres:12345678@localhost:5432/hotelxpress"
#replace:postgres to your postgresql user (postgres not postgresql)
#replace:12345678 to your password
#replace:5432 to your postgresql port
#replace:hotelxpress to any name of the database that you want (don't create it yourself, just give a name)
#server configuration
__SERVER_PORT=5000
#token
__TOKEN=ggggggggggdgdddddkfdf54df54df215f54df54d15dfd1fdf12df1d2f1d
You can also find a .env
example here
- The token just some text that you want which is necessary for the authentification
npm install
The following command includes some inserts, so you don't need to make inserts manually:
npm run init-database
npm start
-
npm run create-database
: This will create your databse whithout insert -
npm run insert-database
: This will insert some data for you (so you have to create the database first). -
npm run init-database
: As we showed earlier, this will create the database and insert data (same asnpm run create-database
and thennpm run insert-database
). -
npm run lint
: This will check all the source code with some rules in.eslintrc
. -
npm run dev
: This will launch the server as atypescript project
with thenodemon
executor (which provides auto-refresh) -
npm run build
: This will build the project as ajavascript project
-
npm start
: Will build and run the project