Code Monkey home page Code Monkey logo

hotelxpress-api's Introduction

HotelXpress API

This is a simple API for HotelXpress, providing essential functionalities to manage hotel operations.

Getting started

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:

1- First, create a file named .env and write your configurations like this:

#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

2- Next, install all dependecies with the following command

npm install

3- Almost there, now you need to create the database before running the server.

The following command includes some inserts, so you don't need to make inserts manually:

npm run init-database

4- That's it, you can now run the server with :

npm start

Another Script

  • 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 as npm run create-database and then npm 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 a typescript project with the nodemon executor (which provides auto-refresh)

  • npm run build : This will build the project as a javascript project

  • npm start : Will build and run the project

hotelxpress-api's People

Contributors

rickaprincy avatar kevindonovan2 avatar lovatiana15 avatar andokami avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.